예제 #1
0
파일: progView.cpp 프로젝트: juriad/tvp
void ProgView::layout() {
	int maxHeight = 0;
	for (int i = 0; i < channelBar.size(); i++) {
		int y = 0;
		QLabel *chan = channelBar.at(i);
		int x = getX(i);
		int width = getKey(CHANNEL_WIDTH).toInt();
		int height = chan->heightForWidth(width);
		if (height > maxHeight) {
			maxHeight = height;
		}
		chan->setGeometry(x, y, width, height);
		chan->show();
		//qDebug() << "x: " << x << "y: " << y;
		//qDebug() << chan->text();
	}
	CHANNELBAR_HEIGHT.def = maxHeight;
	setKey(CHANNELBAR_HEIGHT);
	for (int i = 0; i < timeLine.size(); i++) {
		int x = 0;
		QLabel *lab = timeLine.at(i);
		int y = getY(timeLineDate.value(lab));
		lab->setGeometry(x, y, lab->sizeHint().width(),
				lab->sizeHint().height());
		lab->show();
		//qDebug() << "x: " << x << "y: " << y;
		//qDebug() << lab->text();
	}
}
예제 #2
0
IrsView::IrsView(QAbstractTableModel* model, QWidget* parent) : QTableView(parent) 
{
    this->setModel(model);
    this->setAlternatingRowColors(true);
    this->setSelectionMode(QAbstractItemView::SingleSelection);
    this->setSelectionBehavior(QAbstractItemView::SelectRows);

    LineEditDelegate* delegate = new LineEditDelegate();
    this->setItemDelegate(delegate);

    this->setContextMenuPolicy(Qt::DefaultContextMenu);

    QLabel* tmp = new QLabel("W88 sec, 192000Hz/32bit, 99999-99999 Hz");
    int columnWidth = tmp->sizeHint().width();
    delete tmp;
    this->setColumnWidth(0, columnWidth);
    this->setColumnWidth(1, columnWidth);
    tmp = new QLabel("WW Max Level, db");
    columnWidth = tmp->sizeHint().width();
    delete tmp;
    this->setColumnWidth(2, columnWidth);
    
    this->menu = new QMenu();
    QAction* delAction = this->menu->addAction("Delete measurement");
    connect(delAction, SIGNAL(triggered()), this, SLOT(deleteMeasure()));
    
    // QHeaderView::sectionSizeFromContents()
}
예제 #3
0
CompassFrame::CompassFrame(EQPlayer* player, QWidget* parent, const char* name)
  : SEQWindow("Compass", "ShowEQ - Compass", parent, name)
{
  QVBoxLayout* layout = new QVBoxLayout(this);
  layout->setAutoAdd(true);
  m_compass = new Compass (this, "compass");
  QHBox* coordsbox = new QHBox(this);
  m_compass->setFixedWidth(120);
  m_compass->setFixedHeight(120);

  for(int a=0;a<2;a++) 
  {
    if((a+showeq_params->retarded_coords)%2 == 0) 
    {
      // Create the x: label
      QLabel *labelx = new QLabel(showeq_params->retarded_coords?"E/W:":"X:",
				  coordsbox);
      labelx->setFixedHeight(labelx->sizeHint().height());
      labelx->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
      
      // Create the xpos label
      m_xPos = new QLabel("----",coordsbox);
      m_xPos->setFixedHeight(m_xPos->sizeHint().height());
      m_xPos->setAlignment(QLabel::AlignRight|QLabel::AlignVCenter);
    } 
    else 
    {
      // Create the y: label
      QLabel *labely = new QLabel(showeq_params->retarded_coords?"N/S:":"Y:",
				  coordsbox);
      labely->setFixedHeight(labely->sizeHint().height());
      labely->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
      
      // Create the ypos label
      m_yPos = new QLabel("----",coordsbox);
      m_yPos->setFixedHeight(m_yPos->sizeHint().height());
      m_yPos->setAlignment(QLabel::AlignRight|QLabel::AlignVCenter);
    }
   }
  
  // Create the z: label
  QLabel *labelz = new QLabel("Z:",coordsbox);
  labelz->setFixedHeight(labelz->sizeHint().height());
  labelz->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
  
  // Create the zpos label
  m_zPos = new QLabel("----",coordsbox);
  m_zPos->setFixedHeight(m_zPos->sizeHint().height());      
  m_zPos->setAlignment(QLabel::AlignRight|QLabel::AlignVCenter);

  // connect
  connect(player, SIGNAL(posChanged(int16_t,int16_t,int16_t,
				    int16_t,int16_t,int16_t,int32_t)), 
	  this, SLOT(posChanged(int16_t,int16_t,int16_t,
				int16_t,int16_t,int16_t,int32_t)));

  // initialize compass
  m_compass->setPos(player->getPlayerX(), player->getPlayerY());
  m_compass->setHeading(player->getPlayerHeading());
}
예제 #4
0
void ProgressDialog::setupGui(const QString& heading)
{
    QVBox* vbox = makeVBoxMainWidget();
    vbox->setSpacing(10);

    QWidget* headingBox = new QWidget(vbox);
    QHBoxLayout* hboxLayout = new QHBoxLayout(headingBox);

    QLabel* textLabel = new QLabel(heading, headingBox);
    textLabel->setMinimumWidth(textLabel->sizeHint().width());
    textLabel->setFixedHeight(textLabel->sizeHint().height());
    hboxLayout->addWidget(textLabel);
    hboxLayout->addStretch();

    d->gear = new KAnimWidget(QString("kde"), 32, headingBox);
    d->gear->setFixedSize(32, 32);
    hboxLayout->addWidget(d->gear);

    d->resultbox = new QListBox(vbox);
    d->resultbox->setSelectionMode(QListBox::NoSelection);
    QFontMetrics fm(d->resultbox->fontMetrics());
    d->resultbox->setMinimumSize(fm.width("0")*70, fm.lineSpacing()*8);

    resize(sizeHint());
}
예제 #5
0
void TKAction::updateLayout(QWidget* base)
{
  QLabel* textLabel = (QLabel*)base->child("text");
  QLabel* pixLabel = (QLabel*)base->child("pixmap");
  QWidget* w = (QWidget*)base->child("widget");

  if (!textLabel || !pixLabel || !w)
    return;

  if (!text().isEmpty() && m_imode != TK::IconOnly ) {
    textLabel->setText(text());
    textLabel->show();
  } else
    textLabel->hide();

  QPixmap pix;
  if (hasIcon())
    pix = iconSet(KIcon::Small).pixmap();

  if (!icon().isEmpty())
    pix = BarIcon(icon());

  if (!pix.isNull() && m_imode != TK::TextOnly) {
    pixLabel->setPixmap(pix);
    pixLabel->show();
  } else
    pixLabel->hide();

  base->setFixedWidth( w->sizeHint().width() +
                       (textLabel->isVisible() ? textLabel->sizeHint().width():0) +
                       (pixLabel->isVisible() ? pixLabel->sizeHint().width():0) );
}
예제 #6
0
//-----------------------------------------------------------------------------
About::About (QWidget * aParent, const char *aName, bool aInit)
  : AboutInherited(aParent, aName)
{
  QBoxLayout* box;
  QLabel* lbl;
  QFrame* frm;
  QString str;
  QFont fnt;

  if (aInit) return;

  box = new QVBoxLayout(this, 20, 6);

  lblTheme = new QLabel(" ", this);
  fnt = lblTheme->font();
  fnt.setPointSize(fnt.pointSize() * 1.2);
  lblTheme->setFont(fnt);
  lblTheme->setMinimumSize(lblTheme->sizeHint());
  lblTheme->setAutoResize(true);
  box->addWidget(lblTheme);

  lblVersion = new QLabel(" ", this);
  lblVersion->setMinimumSize(lblVersion->sizeHint());
  lblVersion->setAutoResize(true);
  box->addWidget(lblVersion);

  lblAuthor = new QLabel(" ", this);
  lblAuthor->setMinimumSize(lblAuthor->sizeHint());
  lblAuthor->setAutoResize(true);
  box->addWidget(lblAuthor);

  lblHomepage = new QLabel(" ", this);
  lblHomepage->setMinimumSize(lblHomepage->sizeHint());
  lblHomepage->setAutoResize(true);
  box->addWidget(lblHomepage);

  frm = new QFrame(this);
  frm->setFrameStyle(QFrame::HLine|QFrame::Raised);
  box->addSpacing(5);
  box->addWidget(frm);
  box->addSpacing(5);

  lbl = new QLabel(i18n("KDE Theme Manager"), this);
  lbl->setFont(fnt);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  str.sprintf(i18n("Version %s\n\n"
		   "Copyright (C) 1998 by\n%s\n\n"
		   "Gnu Public License (GPL)"),
	           KTHEME_VERSION, 
                   "Stefan Taferner <*****@*****.**>\n"
                   "Waldo Bastian <*****@*****.**>");
  lbl = new QLabel(str, this);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  box->addStretch(1000);
  box->activate();
}
예제 #7
0
void ArchiveList::fillPartialArchiveItem(PartialArchive *a, QTreeWidgetItem *item)
{
    QTreeWidgetItem *subItem = new QTreeWidgetItem(item);

    QPushButton *pauseButton = new QPushButton();
    pauseButton->setText(a->isDownloading() ? tr("Pause") : tr("Continue"));
    connect(pauseButton, SIGNAL(clicked()), a, SLOT(togglePauseDownload()));
    downloadPausedMapper->setMapping(a, pauseButton);
    downloadStartedMapper->setMapping(a, pauseButton);
    connect(a, SIGNAL(downloadStarted()), downloadStartedMapper, SLOT(map()));
    connect(a, SIGNAL(downloadPaused()), downloadPausedMapper, SLOT(map()));

    int pbarColumn;

    if (compactLayout) {
        pbarColumn = 1;

        subItem->setSizeHint(1, pauseButton->sizeHint());
        setItemWidget(subItem, 1, pauseButton);

        QPushButton *detailsButton = new QPushButton(tr("Details"));
        showDetailsMapper->setMapping(detailsButton, a);
        connect(detailsButton, SIGNAL(clicked()), showDetailsMapper, SLOT(map()));
        subItem->setSizeHint(0, detailsButton->sizeHint());
        setItemWidget(subItem, 0, detailsButton);
    } else {
        pbarColumn = 2;

        item->setSizeHint(3, pauseButton->sizeHint());
        setItemWidget(item, 3, pauseButton);

        item->setText(1, a->getSizeMB());

        QLabel *peerInfo = new QLabel();
        subItem->setSizeHint(1, peerInfo->sizeHint());
        setItemWidget(subItem, 1, peerInfo);
        connect(a, SIGNAL(peerInfoUpdated(QString)), peerInfo, SLOT(setText(QString)));

        QLabel *speedText = new QLabel();
        subItem->setSizeHint(2, speedText->sizeHint());
        setItemWidget(subItem, 2, speedText);
        connect(a, SIGNAL(speedTextUpdated(QString)), speedText, SLOT(setText(QString)));

        QLabel *statusText = new QLabel();
        subItem->setSizeHint(3, statusText->sizeHint());
        setItemWidget(subItem, 3, statusText);
        connect(a, SIGNAL(statusTextUpdated(QString)), statusText, SLOT(setText(QString)));
    }

    QProgressBar *pbar = new QProgressBar();
    pbar->setMinimum(0);
    pbar->setMaximum(100);
    item->setSizeHint(pbarColumn, pbar->sizeHint());
    setItemWidget(item, pbarColumn, pbar);
    connect(a, SIGNAL(progressUpdated(int)), pbar, SLOT(setValue(int)));

    a->emitStatusEvents();
}
예제 #8
0
SaveScm::SaveScm( QWidget *parent, const char *name )
	: QDialog( parent, name, TRUE )
{
	setFocusPolicy(QWidget::StrongFocus);
	setCaption( i18n("Add a color scheme"));
	
	QBoxLayout *topLayout = new QVBoxLayout( this, 10 );

	QBoxLayout *stackLayout = new QVBoxLayout( 3 );
	topLayout->addLayout( stackLayout );

	nameLine = new QLineEdit( this );
	nameLine->setFocus();
	nameLine->setMaxLength(18);
	nameLine->setFixedHeight( nameLine->sizeHint().height() );
	
	QLabel* tmpQLabel;
	tmpQLabel = new QLabel( nameLine, 
			i18n( "&Enter a name for the new color scheme\n"\
					"to be added to your personal list.\n\n"\
					"The colors currently used in the preview will\n"\
					"be copied into this scheme to begin with." ), this );
	tmpQLabel->setAlignment( AlignLeft | AlignBottom | ShowPrefix );
	tmpQLabel->setFixedHeight( tmpQLabel->sizeHint().height() );
	tmpQLabel->setMinimumWidth( tmpQLabel->sizeHint().width() );
	
	stackLayout->addStretch( 10 );
	stackLayout->addWidget( tmpQLabel );
	stackLayout->addWidget( nameLine );
	
	QFrame* tmpQFrame;
	tmpQFrame = new QFrame( this );
	tmpQFrame->setFrameStyle( QFrame::HLine | QFrame::Sunken );
	tmpQFrame->setMinimumHeight( tmpQFrame->sizeHint().height() );
	
	topLayout->addWidget( tmpQFrame );
	
	KButtonBox *bbox = new KButtonBox( this );
	bbox->addStretch( 10 );
	
	QPushButton *ok = bbox->addButton( i18n( "&OK" ) );
	connect( ok, SIGNAL( clicked() ), SLOT( accept() ) );
	
	QPushButton *cancel = bbox->addButton( i18n( "&Cancel" ) );
	connect( cancel, SIGNAL( clicked() ), SLOT( reject() ) );
	
	bbox->layout();
	topLayout->addWidget( bbox );

    topLayout->activate();
	
	resize( 250, 0 );
}
예제 #9
0
KLocaleConfig::KLocaleConfig(QWidget *parent, const char *name)
  : KConfigWidget (parent, name)
{
  QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
  QGridLayout *tl1 = new QGridLayout(5, 4, 5);
  tl->addLayout(tl1);
  tl->addStretch(1);

  gbox = new QGroupBox(klocale->translate("Language"), this);
  tl1->addMultiCellWidget(gbox, 0, 4, 0, 3);
  tl1->addRowSpacing(0, 10);
  tl1->addRowSpacing(4, 15);
  tl1->addColSpacing(0, 10);
  tl1->addColSpacing(3, 10);
  tl1->setColStretch(2, 1);

  changedFlag = FALSE;
 
  QLabel *label = new QLabel(klocale->translate("First"), gbox);
  label->setMinimumSize(label->sizeHint());
  combo1 = new KLanguageCombo(gbox);
  combo1->setMinimumWidth(combo1->sizeHint().width());
  combo1->setFixedHeight(combo1->sizeHint().height());
  label->setBuddy(combo1);
  connect(combo1,SIGNAL(highlighted(int)),this,SLOT(changed(int)));
  tl1->addWidget(label, 1, 1);
  tl1->addWidget(combo1, 1, 2);

  label = new QLabel(klocale->translate("Second"), gbox);
  label->setMinimumSize(label->sizeHint());
  combo2 = new KLanguageCombo(gbox);
  combo2->setMinimumWidth(combo2->sizeHint().width());
  combo2->setFixedHeight(combo2->sizeHint().height());
  label->setBuddy(combo2);
  connect(combo2,SIGNAL(highlighted(int)),this,SLOT(changed(int)));
  tl1->addWidget(label, 2, 1);
  tl1->addWidget(combo2, 2, 2);

  label = new QLabel(klocale->translate("Third"), gbox);
  label->setMinimumSize(label->sizeHint());
  combo3 = new KLanguageCombo(gbox);
  combo3->setMinimumWidth(combo3->sizeHint().width());
  combo3->setFixedHeight(combo3->sizeHint().height());
  label->setBuddy(combo3);
  connect(combo3,SIGNAL(highlighted(int)),this,SLOT(changed(int)));
  tl1->addWidget(label, 3, 1);
  tl1->addWidget(combo3, 3, 2);

  tl->activate();

  loadSettings();
}
예제 #10
0
파일: msgdlg.cpp 프로젝트: xbackupx/showeqx
//
//
// CButDlg Class
//
// Provide a dialog to add/edit a filter button to the MsgDialog 
//
CButDlg::CButDlg(QWidget *parent, QString name, MyButton *but)
  : QDialog(parent, name, TRUE)
{
   QBoxLayout *topLayout = new QVBoxLayout(this);
   QBoxLayout *row1Layout = new QHBoxLayout(topLayout);
   QBoxLayout *row2Layout = new QHBoxLayout(topLayout);

   QFont labelFont(font());
   labelFont.setBold(true);

   QLabel *nameLabel = new QLabel ("Name", this);
   nameLabel->setFont(labelFont);
   nameLabel->setFixedHeight(nameLabel->sizeHint().height());
   nameLabel->setFixedWidth(80);
   nameLabel->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
   row1Layout->addWidget(nameLabel);
  
   QLineEdit *nameEdit = new QLineEdit (this, "Name");
   nameEdit->setText(but->text());
   nameEdit->setFont(labelFont);
   nameEdit->setFixedHeight(nameEdit->sizeHint().height());
   nameEdit->setFixedWidth(150);
   row1Layout->addWidget(nameEdit);

   QLabel *filterLabel = new QLabel ("Filter", this);
   filterLabel->setFont(labelFont);
   filterLabel->setFixedHeight(filterLabel->sizeHint().height());
   filterLabel->setFixedWidth(80);
   filterLabel->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
   row2Layout->addWidget(filterLabel);
  
   QLineEdit *filterEdit = new QLineEdit (this, "Filter");
   filterEdit->setText(but->filter());
   filterEdit->setFont(labelFont);
   filterEdit->setFixedHeight(filterEdit->sizeHint().height());
   filterEdit->setFixedWidth(150);
   row2Layout->addWidget(filterEdit);

   QPushButton *ok = new QPushButton("OK", this);
   ok->setFixedWidth(30);
   ok->setFixedHeight(30);
   topLayout->addWidget(ok, 0, AlignCenter);
 
   // connect sigs
   connect(nameEdit, SIGNAL(textChanged(const QString &)),
      but, SLOT(setText(const QString &)));  
   connect(filterEdit, SIGNAL(textChanged(const QString &)),
      but, SLOT(setFilter(const QString &)));  
   connect(ok, SIGNAL(clicked()), SLOT(accept()));

   setMaximumSize(QSize(sizeHint()));
}
예제 #11
0
void ImageView::setMovie(QMovie *movie)
{
  reset();

  QLabel *label = new QLabel();
  label->setMovie(movie);
  movie->setParent(label);

  movie->start();

  m_proxy = m_scene->addWidget(label);
  m_scene->setSceneRect(0, 0, label->sizeHint().width(), label->sizeHint().height());
}
예제 #12
0
파일: ClsQPrcMonitor.cpp 프로젝트: jeez/iqr
/** 
 * Constructor
 */
ClsQPrcMonitor::ClsQPrcMonitor(QWidget *parent, const char * /* name=0 */, WFlags /* f=0 */) : 
//     QWidget ( parent, name,  WStyle_Title |WStyle_NoBorder ) {
     QDialog ( parent) {


     QPixmap qpixmapPrc_alive = QPixmap (prc_alive);  

     
     qpixmapPrc_launched = QPixmap (prc_launched);
     qpixmapPrc_ready = QPixmap (prc_ready);  
     qpixmapPrc_sfp = QPixmap (prc_sfp);   
     qpixmapPrc_mt = QPixmap (prc_mt);    

     this->setBackgroundColor(QColor(0,0,0));
     qgltPrcs = new QGridLayout( this, 1, 8, 1 );

     QLabel *l;

     l = new QLabel(" PrcID ", this, "PrcID", 0); 
     l->setFixedHeight(l->sizeHint().height());
     qgltPrcs->addWidget(l,0,0);

     l = new QLabel("port ", this, "port", 0); 
     l->setFixedHeight(l->sizeHint().height());
     qgltPrcs->addWidget(l,0,1);

     l = new QLabel("A", this, "A", 0); l->setAlignment(AlignCenter);
     QToolTip::add( l, "Prc alive" );
     qgltPrcs->addWidget(l,0,2);

     l = new QLabel("P", this, "P", 0); l->setAlignment(AlignCenter);
     QToolTip::add( l, "Prc systemfile parsed" );
     qgltPrcs->addWidget(l,0,3);

     l = new QLabel("B", this, "B", 0); l->setAlignment(AlignCenter);
     QToolTip::add( l, "Prc system buildt" );
     qgltPrcs->addWidget(l,0,4);

     l = new QLabel("C", this, "C", 0); l->setAlignment(AlignCenter);
     QToolTip::add( l, "Prc connected" );
     qgltPrcs->addWidget(l,0,5);

     l = new QLabel("R", this, "R", 0); l->setAlignment(AlignCenter);
     QToolTip::add( l, "Prc ready" );
     qgltPrcs->addWidget(l,0,6);

     l = new QLabel(" speed ", this, "speed", 0);
     l->setFixedHeight(l->sizeHint().height());
     qgltPrcs->addWidget(l,0,NR_STATES+2);
};
예제 #13
0
KResize::KResize(QWidget *parent, const char *name, bool m, const QSize s )
 : QDialog( parent, name, m )
{
  setFocusPolicy(QWidget::NoFocus);
  grp = new QGroupBox(i18n("Size:"), this);
  QLabel *label = new QLabel("X", grp);
  x_line = new KIntegerLine(grp);
  connect(x_line, SIGNAL(valueChanged(int)), SLOT(checkValue(int)));
  x_line->setFixedSize(100, label->sizeHint().height()+10);
  y_line = new KIntegerLine(grp);
  connect(y_line, SIGNAL(valueChanged(int)), SLOT(checkValue(int)));
  y_line->setFixedSize(100, label->sizeHint().height()+10);
  label->setFixedSize(label->sizeHint());

  ml = new QVBoxLayout(this, 10);
  ml->addWidget(grp, 10, AlignLeft);
  l0 = new QHBoxLayout(grp, 20);
  l0->addWidget(x_line);
  l0->addWidget(label);
  l0->addWidget(y_line);
  l0->activate();
  if(testWFlags(WType_Modal))
  {
    connect(x_line, SIGNAL(returnPressed()), SLOT(slotReturnPressed()));
    connect(y_line, SIGNAL(returnPressed()), SLOT(slotReturnPressed()));
    ok = new QPushButton(i18n("&OK"), this);
    connect(ok, SIGNAL(clicked()), SLOT(accept()));
    ok->setFixedSize(ok->sizeHint());
    ok->setEnabled(false);
    ok->setDefault(true);
    cancel = new QPushButton(i18n("&Cancel"), this);
    connect(cancel, SIGNAL(clicked()), SLOT(reject()));
    cancel->setFixedSize(cancel->sizeHint());
    QBoxLayout *l1 = new QHBoxLayout();
    ml->addLayout(l1);
    l1->addWidget(ok);
    l1->addWidget(cancel);
    l1->addStretch(1);
    ml->freeze();
    setCaption(i18n("Select size:"));
  }
  else
    ml->activate();

  x_line->setValue(s.width());
  y_line->setValue(s.height());
  checkValue(0);
}
예제 #14
0
KWMailMergeVariableInsertDia::KWMailMergeVariableInsertDia( QWidget *parent, KWMailMergeDataBase *db )
  : KDialogBase( Plain, i18n( "Mail Merge - Variable Name" ),
                 Ok | Cancel, Ok, parent, "", true )
{
  m_db=db;
  QWidget *page = plainPage();

  QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() );
  layout->setAutoAdd( true );

  QLabel *l = new QLabel( i18n( "Name:" ), page );
  l->setMaximumHeight( l->sizeHint().height() );
  names = new QListBox( page );

  QMap< QString, QString >::ConstIterator it = db->getRecordEntries().begin();
  for ( ; it != db->getRecordEntries().end(); ++it )
    names->insertItem( m_db->version() ?it.data():it.key(), -1 );

  setInitialSize( QSize( 350, 400 ) );
  connect( names, SIGNAL( selectionChanged() ),
           this, SLOT( slotSelectionChanged() ) );
  connect( names, SIGNAL( doubleClicked( QListBoxItem* ) ),
           this, SLOT( slotOk() ) );

  setFocus();
  enableButtonOK( names->currentItem() != -1 );
}
예제 #15
0
void BGDialog::slotIdentifyScreens()
{
    // Taken from PositionTab::showIdentify in kdebase/kcontrol/kicker/positiontab_impl.cpp
    for (unsigned s = 0; s < m_numScreens; s++) {
        QLabel *screenLabel = new QLabel(0, Qt::X11BypassWindowManagerHint);
        screenLabel->setObjectName("Screen Identify");

        QFont identifyFont(KGlobalSettings::generalFont());
        identifyFont.setPixelSize(100);
        screenLabel->setFont(identifyFont);

        screenLabel->setFrameStyle(QFrame::Panel);
        screenLabel->setFrameShadow(QFrame::Plain);

        screenLabel->setAlignment(Qt::AlignCenter);
        screenLabel->setNum(int(s + 1));
        // BUGLET: we should not allow the identification to be entered again
        //         until the timer fires.
        QTimer::singleShot(1500, screenLabel, SLOT(deleteLater()));

        QPoint screenCenter(QApplication::desktop()->screenGeometry(s).center());
        QRect targetGeometry(QPoint(0, 0), screenLabel->sizeHint());
        targetGeometry.moveCenter(screenCenter);

        screenLabel->setGeometry(targetGeometry);

        screenLabel->show();
    }
}
예제 #16
0
void Wizard::setupPage1()
{
    page1 = new QHBox( this );
    page1->setSpacing(8);

    QLabel *info = new QLabel( page1 );
    info->setPalette( yellow );
    info->setText( "Enter your personal\n"
                   "key here.\n\n"
                   "Your personal key\n"
                   "consists of 4 digits" );
    info->setIndent( 8 );
    info->setMaximumWidth( info->sizeHint().width() );

    QVBox *page = new QVBox( page1 );

    QHBox *row1 = new QHBox( page );

    (void)new QLabel( "Key:", row1 );

    key = new QLineEdit( row1 );
    key->setMaxLength( 4 );
    key->setValidator( new QIntValidator( 9999, 0, key ) );

    connect( key, SIGNAL( textChanged( const QString & ) ), this, SLOT( keyChanged( const QString & ) ) );

    addPage( page1, "Personal Key" );

    setNextEnabled( page1, FALSE );
    setHelpEnabled( page1, FALSE );
}
예제 #17
0
QWidget *Summary::createHeader(QWidget *parent, const QPixmap &icon, const QString &heading)
{
    QHBox *hbox = new QHBox(parent);
    hbox->setMargin(2);

    QFont boldFont;
    boldFont.setBold(true);
    boldFont.setPointSize(boldFont.pointSize() + 2);

    QLabel *label = new QLabel(hbox);
    label->setPixmap(icon);
    label->setFixedSize(label->sizeHint());
    label->setPaletteBackgroundColor(colorGroup().mid());
    label->setAcceptDrops(true);

    label = new QLabel(heading, hbox);
    label->setAlignment(AlignLeft | AlignVCenter);
    label->setIndent(KDialog::spacingHint());
    label->setFont(boldFont);
    label->setPaletteForegroundColor(colorGroup().light());
    label->setPaletteBackgroundColor(colorGroup().mid());

    hbox->setPaletteBackgroundColor(colorGroup().mid());

    hbox->setMaximumHeight(hbox->minimumSizeHint().height());

    return hbox;
}
예제 #18
0
CcaseCommentDlg::CcaseCommentDlg(bool bCheckin)
  : QDialog(0, "", true)
{
  setCaption( i18n("Clearcase Comment") );

  QBoxLayout *layout = new QVBoxLayout(this, 10);

  QLabel *messagelabel = new QLabel(i18n("Enter log message:"), this);
  messagelabel->setMinimumSize(messagelabel->sizeHint());
  layout->addWidget(messagelabel, 0);

  _edit = new QMultiLineEdit(this);
  QFontMetrics fm(_edit->fontMetrics());
  _edit->setMinimumSize(fm.width("0")*40, fm.lineSpacing()*3);
  layout->addWidget(_edit, 10);

  QBoxLayout *layout2 = new QHBoxLayout(layout);
  if(bCheckin) {
    _check = new QCheckBox(i18n("Reserve"), this);
    layout2->addWidget(_check);
  }

  KButtonBox *buttonbox = new KButtonBox(this);
  buttonbox->addStretch();
  QPushButton *ok = buttonbox->addButton(KStdGuiItem::ok());
  QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
  connect(ok, SIGNAL(clicked()), SLOT(accept()) );
  connect(cancel, SIGNAL(clicked()), SLOT(reject()) );
  ok->setDefault(true);
  buttonbox->layout();
  layout2->addWidget(buttonbox, 0);

  layout->activate();
  adjustSize();
}
예제 #19
0
void Wizard::setupPage3()
{
    page3 = new QHBox( this );
    page3->setSpacing(8);

    QLabel *info = new QLabel( page3 );
    info->setPalette( yellow );
    info->setText( "\n"
                   "  Look here to see of  \n"
                   "  the data you entered  \n"
                   "  is correct. To confirm,  \n"
                   "  press the [Finish] button  \n"
                   "  else go back to correct  \n"
                   "  mistakes." );
    info->setIndent(8);
    info->setAlignment( AlignTop|AlignLeft );
    info->setMaximumWidth( info->sizeHint().width() );

    QVBox *page = new QVBox( page3 );

    QHBox *row1 = new QHBox( page );
    QHBox *row2 = new QHBox( page );
    QHBox *row3 = new QHBox( page );
    QHBox *row4 = new QHBox( page );
    QHBox *row5 = new QHBox( page );
    QHBox *row6 = new QHBox( page );

    QLabel *label1 = new QLabel( " Personal Key: ", row1 );
    label1->setAlignment( Qt::AlignVCenter );
    QLabel *label2 = new QLabel( " First Name: ", row2 );
    label2->setAlignment( Qt::AlignVCenter );
    QLabel *label3 = new QLabel( " Last Name: ", row3 );
    label3->setAlignment( Qt::AlignVCenter );
    QLabel *label4 = new QLabel( " Address: ", row4 );
    label4->setAlignment( Qt::AlignVCenter );
    QLabel *label5 = new QLabel( " Phone Number: ", row5 );
    label5->setAlignment( Qt::AlignVCenter );
    QLabel *label6 = new QLabel( " E-Mail: ", row6 );
    label6->setAlignment( Qt::AlignVCenter );

    label1->setMinimumWidth( label1->sizeHint().width() );
    label2->setMinimumWidth( label1->sizeHint().width() );
    label3->setMinimumWidth( label1->sizeHint().width() );
    label4->setMinimumWidth( label1->sizeHint().width() );
    label5->setMinimumWidth( label1->sizeHint().width() );
    label6->setMinimumWidth( label1->sizeHint().width() );

    lKey = new QLabel( row1 );
    lFirstName = new QLabel( row2 );
    lLastName = new QLabel( row3 );
    lAddress = new QLabel( row4 );
    lPhone = new QLabel( row5 );
    lEmail = new QLabel( row6 );

    addPage( page3, "Finish" );

    setFinish( page3, TRUE );
    setHelpEnabled( page3, FALSE );
}
예제 #20
0
	void showToolTip(const QModelIndex &index)
	{
		if (!index.isValid()) {
			m_tooltip->hide();
			return;
		}
		QVariant data = model()->data(index, Qt::ToolTipRole);
		if (!data.isValid()) {
			m_tooltip->hide();
			return;
		}
		QRect rect = visualRect(index);
		m_tooltip->setText(data.toString());
		QPoint pos = viewport()->mapToGlobal(QPoint(-m_tooltip->sizeHint().width(), rect.top()));
		m_tooltip->setGeometry(QRect(pos, m_tooltip->sizeHint()));
		m_tooltip->show();
	}
예제 #21
0
void GreatWindow::setupStatusBar()
{
    QLabel* statusLabel = new QLabel("");
    statusLabel->setAlignment(Qt::AlignLeft);
    statusLabel->setMinimumWidth(100);

    QLabel* resolutionLabel = new QLabel("");
    resolutionLabel->setAlignment(Qt::AlignLeft);
    resolutionLabel->setMinimumWidth(150);

    QLabel* zoomLabel = new QLabel("");
    zoomLabel->setAlignment(Qt::AlignLeft);
    zoomLabel->setMinimumWidth(100);

    QLabel* urlLabel = new QLabel("");
    urlLabel->setAlignment(Qt::AlignLeft);
    urlLabel->setMinimumWidth(400);

    QPushButton* zoomInButton = new QPushButton(QString(0x2295));
    zoomInButton->setMaximumWidth(urlLabel->sizeHint().height());
    zoomInButton->setMaximumHeight(urlLabel->sizeHint().height());
    zoomInButton->setFocusPolicy(Qt::NoFocus);

    QPushButton* zoomOutButton = new QPushButton(QString(0x2296));
    zoomOutButton->setMaximumWidth(urlLabel->sizeHint().height());
    zoomOutButton->setMaximumHeight(urlLabel->sizeHint().height());
    zoomOutButton->setFocusPolicy(Qt::NoFocus);

    statusBar()->addWidget(statusLabel);
    statusBar()->addWidget(resolutionLabel);
    statusBar()->addWidget(zoomLabel);
    statusBar()->addWidget(zoomInButton);
    statusBar()->addWidget(zoomOutButton);
    statusBar()->addWidget(urlLabel, 1);

    m_statusLabels[0] = statusLabel;
    m_statusLabels[1] = resolutionLabel;
    m_statusLabels[2] = zoomLabel;
    m_statusLabels[3] = urlLabel;

    connect(zoomInButton, &QPushButton::clicked,
            m_canvas, [this] {m_canvas->zoom(true); updateZoom(); });
    connect(zoomOutButton, &QPushButton::clicked,
            m_canvas, [this] {m_canvas->zoom(false); updateZoom(); });
}
예제 #22
0
파일: prefmisc.cpp 프로젝트: albfan/kdbg
void PrefMisc::setupEditGroup(const QString& label, QLabel& labWidget, QLineEdit& edit, int row)
{
    labWidget.setText(label);
    labWidget.setMinimumSize(labWidget.sizeHint());
    labWidget.setBuddy(&edit);
    edit.setMinimumSize(edit.sizeHint());
    m_grid.addWidget(&labWidget, row, 0);
    m_grid.addWidget(&edit, row, 1);
}
예제 #23
0
void KFilePreview::init( KFileView *view )
{
    setViewName( i18n("Preview") );

    left = 0L;
    setFileView( view );

    preview = new QWidget((QSplitter*)this, "preview");
    QString tmp = i18n("No preview available.");
    QLabel *l = new QLabel(tmp, preview);
    l->setMinimumSize(l->sizeHint());
    l->move(10, 5);
    preview->setMinimumWidth(l->sizeHint().width()+20);
    setResizeMode(preview, QSplitter::KeepSize);

    // Why copy the actions? --ellis, 13 Jan 02.
    //for ( uint i = 0; i < view->actionCollection()->count(); i++ )
    //    actionCollection()->insert( view->actionCollection()->action( i ));
}
예제 #24
0
void Wizard::setupPage2()
{
    page2 = new QHBox( this );
    page2->setSpacing(8);

    QLabel *info = new QLabel( page2 );
    info->setPalette( yellow );
    info->setText( "\n"
                   "  Enter your personal  \n"
                   "  data here.  \n\n"
                   "  The required fields are  \n"
                   "  First Name, Last Name \n"
                   "  and E-Mail.  \n" );
    info->setIndent(8);
    info->setMaximumWidth( info->sizeHint().width() );

    QVBox *page = new QVBox( page2 );

    QHBox *row1 = new QHBox( page );
    QHBox *row2 = new QHBox( page );
    QHBox *row3 = new QHBox( page );
    QHBox *row4 = new QHBox( page );
    QHBox *row5 = new QHBox( page );

    QLabel *label1 = new QLabel( " First Name: ", row1 );
    label1->setAlignment( Qt::AlignVCenter );
    QLabel *label2 = new QLabel( " Last Name: ", row2 );
    label2->setAlignment( Qt::AlignVCenter );
    QLabel *label3 = new QLabel( " Address: ", row3 );
    label3->setAlignment( Qt::AlignVCenter );
    QLabel *label4 = new QLabel( " Phone Number: ", row4 );
    label4->setAlignment( Qt::AlignVCenter );
    QLabel *label5 = new QLabel( " E-Mail: ", row5 );
    label5->setAlignment( Qt::AlignVCenter );

    label1->setMinimumWidth( label4->sizeHint().width() );
    label2->setMinimumWidth( label4->sizeHint().width() );
    label3->setMinimumWidth( label4->sizeHint().width() );
    label4->setMinimumWidth( label4->sizeHint().width() );
    label5->setMinimumWidth( label4->sizeHint().width() );

    firstName = new QLineEdit( row1 );
    lastName = new QLineEdit( row2 );
    address = new QLineEdit( row3 );
    phone = new QLineEdit( row4 );
    email = new QLineEdit( row5 );

    connect( firstName, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged( const QString & ) ) );
    connect( lastName, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged( const QString & ) ) );
    connect( email, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged( const QString & ) ) );

    addPage( page2, "Personal Data" );

    setHelpEnabled( page2, FALSE );
}
예제 #25
0
PcmciaConfig::PcmciaConfig (QWidget * parent, const char *name)
  : KCModule(parent, name)
{
       KAboutData *about =
       new KAboutData(I18N_NOOP("kcmlaptop"),
		   I18N_NOOP("KDE Panel System Information Control Module"),
		   0, 0, KAboutData::License_GPL,
		   I18N_NOOP("(c) 1999 - 2002 Paul Campbell"));
       about->addAuthor("Paul Campbell", 0, "*****@*****.**");
       setAboutData( about );

       KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages

       label0 = laptop_portable::pcmcia_info(0, this);
       label0_text = laptop_portable::pcmcia_info(1, this);
       label1 = laptop_portable::pcmcia_info(2, this);
       label1_text = laptop_portable::pcmcia_info(3, this);
	

       QVBoxLayout *top_layout = new QVBoxLayout(this, 15, 5);
        QGridLayout *top_grid = new QGridLayout(2, 2);
        top_layout->addLayout(top_grid);

        top_grid->setColStretch(0, 0);
        top_grid->setColStretch(1, 1);
        top_grid->addRowSpacing(0, 40);
        top_grid->addRowSpacing(1, 40);

        label0->setFixedSize(80, 24);
        top_grid->addWidget(label0, 0, 0);
        label0_text->adjustSize();
        top_grid->addWidget(label0_text, 0, 1);

        label1->setFixedSize(80, 24);
        top_grid->addWidget(label1, 1, 0);
        label1_text->adjustSize();
        top_grid->addWidget(label1_text, 1, 1);


        top_layout->addStretch(1);

        QHBoxLayout *v1 = new QHBoxLayout;
        top_layout->addLayout(v1, 0);
        v1->addStretch(1);
        QString s1 = LAPTOP_VERSION;
        QString s2 = i18n("Version: ")+s1;
        QLabel* vers = new QLabel(s2, this);
        vers->setMinimumSize(vers->sizeHint());
        v1->addWidget(vers, 0);

        top_layout->activate();          

	load();
	setButtons(Help);
}
예제 #26
0
KFindTextDialog::KFindTextDialog( QWidget *parent, const char *name )
    : QDialog( parent, name )
{
    // mimimise initial size of dialog
    resize( 0, 0 );

    QVBoxLayout *vl = new QVBoxLayout( this, 15 );

    QHBoxLayout *hl = new QHBoxLayout( 15 );
    vl->addLayout( hl );

    QLabel *label = new QLabel( i18n( "Find:" ), this );
    label->setFixedSize( label->sizeHint() );

    QLineEdit *edit = new QLineEdit( this );
    edit->setFixedHeight( edit->sizeHint().height() );
    edit->setFocus();
    connect( edit, SIGNAL( textChanged( const char * ) ),
		    SLOT( slotTextChanged( const char * ) ) );

    hl->addWidget( label );
    hl->addWidget( edit );

    hl = new QHBoxLayout;
    vl->addLayout( hl );

    QCheckBox *cb = new QCheckBox( i18n( "Case &sensitive" ), this );
    connect( cb, SIGNAL( toggled( bool ) ), this, SLOT( slotCase( bool ) ) );
    cb->setFixedSize( cb->sizeHint() );
    hl->addWidget( cb );

    hl->addStretch();

    hl = new QHBoxLayout( 15 );
    vl->addLayout( hl );

    QPushButton *btn = new QPushButton( i18n( "&Find" ), this );
    btn->setFixedSize( btn->sizeHint() );
    btn->setDefault( true );
    connect( btn, SIGNAL( clicked() ), this, SLOT( slotFind() ) );
    hl->addWidget( btn );

    hl->addStretch();

    btn = new QPushButton( i18n( "&Close" ), this );
    btn->setFixedSize( btn->sizeHint() );
    connect( btn, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
    hl->addWidget( btn );

    vl->activate();

    rExp.setCaseSensitive( false );
}
예제 #27
0
FieldSelect::FieldSelect(Procview *pv, Proc *proc)
            : QDialog(0, "select fields"),
	      nbuttons(proc->cats.size()),
	      disp_fields(nbuttons),
	      procview(pv)
{
    QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);

    updating = FALSE;
    setCaption("qps: select fields");
    buts = new QCheckBox*[nbuttons];

    QGridLayout *l1 = new QGridLayout((nbuttons + 1) / 2, 5, 0);
    tl->addLayout(l1, 1);
    l1->addColSpacing(2, 15);

    int half = (nbuttons + 1) / 2;
    for(int i = 0; i < nbuttons; i++) {
      QCheckBox *but = new QCheckBox(proc->cats[i]->name, this);
	QLabel *desc = new QLabel(proc->cats[i]->help, this);
	but->setMinimumSize(but->sizeHint());
	desc->setMinimumSize(desc->sizeHint());

	if(i < half) {
	  l1->addWidget(but, i, 0);
	  l1->addWidget(desc, i, 1);
	} else {
	  l1->addWidget(but, i-half, 3);
	  l1->addWidget(desc, i-half, 4);
	}
	buts[i] = but;
	connect(but, SIGNAL(toggled(bool)), this, SLOT(field_toggled(bool)));
    }
    update_boxes();

    KButtonBox *bbox = new KButtonBox(this);
    bbox->addStretch(1);
    QPushButton *closebut = bbox->addButton(i18n("Close"));
    closebut->setDefault(TRUE);
    closebut->setFocus();
    closebut->setFixedSize(closebut->sizeHint());
    bbox->layout();
    tl->addWidget(bbox);

    connect(closebut, SIGNAL(clicked()), SLOT(closed()));

    QAccel *acc = new QAccel(this);
    acc->connectItem(acc->insertItem(CTRL + Key_W),
		     this, SLOT(closed()));
    tl->freeze();
}
예제 #28
0
void LogListWidget::appendLine(const QString &line)
{
  QListWidgetItem *item = new QListWidgetItem;
  // We need to use QLabel here to support rich text
  QLabel *lbl = new QLabel(line);
  lbl->setContentsMargins(4, 2, 4, 2);
  item->setSizeHint(lbl->sizeHint());
  insertItem(0, item);
  setItemWidget(item, lbl);
  const int nbLines = count();
  // Limit log size
  if (nbLines > m_maxLines)
    delete takeItem(nbLines - 1);
}
SoundPicker::SoundPicker(QWidget* parent)
    : QFrame(parent),
      mRevertType(false)
{
    QHBoxLayout* soundLayout = new QHBoxLayout(this);
    soundLayout->setMargin(0);
    soundLayout->setSpacing(KDialog::spacingHint());
    mTypeBox = new KHBox(this);    // this is to control the QWhatsThis text display area
    mTypeBox->setMargin(0);
    mTypeBox->setSpacing(KDialog::spacingHint());

    QLabel* label = new QLabel(i18n_label_Sound(), mTypeBox);
    label->setFixedSize(label->sizeHint());

    // Sound type combo box
    // The order of combo box entries must correspond with the 'Type' enum.
    if (indexes.isEmpty())
    {
        indexes[Preferences::Sound_None]     = 0;
        indexes[Preferences::Sound_Beep]     = 1;
        indexes[Preferences::Sound_File] = 2;
        indexes[Preferences::Sound_Speak]    = 3;
    }

    mTypeCombo = new ComboBox(mTypeBox);
    mTypeCombo->addItem(i18n_combo_None());     // index None
    mTypeCombo->addItem(i18n_combo_Beep());     // index Beep
    mTypeCombo->addItem(i18n_combo_File());     // index PlayFile
    mSpeakShowing = !theApp()->speechEnabled();
    showSpeak(!mSpeakShowing);            // index Speak (only displayed if appropriate)
    connect(mTypeCombo, SIGNAL(activated(int)), SLOT(slotTypeSelected(int)));
    connect(mTypeCombo, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()));
    label->setBuddy(mTypeCombo);
    soundLayout->addWidget(mTypeBox);

    // Sound file picker button
    mFilePicker = new PushButton(this);
    mFilePicker->setIcon(KIcon(SmallIcon("audio-x-generic")));
    int size = mFilePicker->sizeHint().height();
    mFilePicker->setFixedSize(size, size);
    connect(mFilePicker, SIGNAL(clicked()), SLOT(slotPickFile()));
    mFilePicker->setToolTip(i18nc("@info:tooltip", "Configure sound file"));
    mFilePicker->setWhatsThis(i18nc("@info:whatsthis", "Configure a sound file to play when the alarm is displayed."));
    soundLayout->addWidget(mFilePicker);

    // Initialise the file picker button state and tooltip
    mTypeCombo->setCurrentIndex(indexes[Preferences::Sound_None]);
    mFilePicker->setEnabled(false);
}
예제 #30
0
ViewSizeDialog::ViewSizeDialog(QWidget *parent, int w, int h)
        : QDialog(parent)
{
    QLabel *label = new QLabel(i18n(
                                   "Resize the window to select the image size\n"
                                   "and close it or press Escape to accept changes."), this);
    label->move(8, 8);
    label->setFixedSize(label->sizeHint());

    // setSizeGripEnabled(true) doesn't work (the grip stay at the same place), so we emulate it:
    m_sizeGrip = new QSizeGrip(this);
    m_sizeGrip->setFixedSize(m_sizeGrip->sizeHint());

    setGeometry(x(), y(), w, h);
}