//added by Rolando 04-11-08 QtFlagsListWidget::QtFlagsListWidget( QWidget * parent): QDialog(parent) { //VOXOX CHANGE by Rolando - 2009.06.12 _qListWidget = new QListWidget();//VOXOX CHANGE by Rolando - 2009.06.12 _qListWidget->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding);//VOXOX CHANGE by Rolando - 2009.06.11 if (!layout()) {//VOXOX CHANGE by Rolando - 2009.06.12 Widget::createLayout(this);//VOXOX CHANGE by Rolando - 2009.06.12 } layout()->addWidget(_qListWidget);//VOXOX CHANGE by Rolando - 2009.06.12 setContentsMargins(0,0,0,0);//VOXOX CHANGE by Rolando - 2009.06.12 _qListWidget->setWindowOpacity(0.95);//VOXOX CHANGE by Rolando - 2009.06.12 _qListWidget->setVerticalScrollMode ( QAbstractItemView::ScrollPerItem ); setFixedHeight ( HEIGHT_SIZE ); setFixedWidth(WIDTH_SIZE); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setAttribute( Qt::WA_GroupLeader, TRUE ); setWindowTitle(QString("VoxOx - Countries Codes")); //SAFE_CONNECT(_qListWidget, SIGNAL(currentTextChanged(QString)), SLOT(currentTextChangedSlot(QString)));//VOXOX CHANGE Rolando 03-24-09 SAFE_CONNECT(_qListWidget, SIGNAL(itemClicked(QListWidgetItem *)), SLOT(itemClickedSlot(QListWidgetItem *)));//VOXOX CHANGE by Rolando - 2009.06.12 }
NextPageWidget::NextPageWidget(QFrame *parent) : SettingsItem(parent), m_title(new NormalLabel), m_value(new TipsLabel), m_nextPageBtn(new dcc::widgets::NextButton) { QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->setSpacing(0); mainLayout->setMargin(0); mainLayout->setContentsMargins(20, 0, 10, 0); mainLayout->addWidget(m_title); mainLayout->addStretch(); mainLayout->addWidget(m_value); mainLayout->addSpacing(5); mainLayout->addWidget(m_nextPageBtn); setFixedHeight(36); setLayout(mainLayout); setObjectName("NextPageWidget"); connect(m_nextPageBtn, &widgets::NextButton::clicked, this, &NextPageWidget::acceptNextPage); connect(m_nextPageBtn, &widgets::NextButton::clicked, this, &NextPageWidget::clicked); }
FindDialog::FindDialog( QWidget * parent ) : QDialog( parent ) { label = new QLabel( tr( "Find &what" ) ); lineEdit = new QLineEdit; label->setBuddy( lineEdit ); caseCheckBox = new QCheckBox( tr( "Match &case" ) ); backwardCheckBox = new QCheckBox( tr( "Search &backward" ) ); findButton = new QPushButton( tr( "&Find" ) ); findButton->setDefault( true ); findButton->setEnabled( false ); closeButton = new QPushButton( tr( "Close" ) ); connect( lineEdit, SIGNAL( textChanged( const QString &) ), this, SLOT( enableFindButton( const QString & ) ) ); connect( findButton, SIGNAL( clicked() ), this, SLOT( findClicked() ) ); connect( closeButton, SIGNAL( clicked() ), this, SLOT( close() ) ); QHBoxLayout *topLeftLayout = new QHBoxLayout; topLeftLayout->addWidget( label ); topLeftLayout->addWidget( lineEdit ); QVBoxLayout *leftLayout = new QVBoxLayout; leftLayout->addLayout( topLeftLayout ); leftLayout->addWidget( caseCheckBox ); leftLayout->addWidget( backwardCheckBox ); QVBoxLayout *rightLayout = new QVBoxLayout; rightLayout->addWidget( findButton ); rightLayout->addWidget( closeButton ); rightLayout->addStretch(); QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->addLayout( leftLayout ); mainLayout->addLayout( rightLayout ); setLayout( mainLayout ); setWindowTitle( tr( "Find" ) ); setFixedHeight( sizeHint().height() ); }
SortWidget::SortWidget( QWidget *parent ) : QWidget( parent ) { setFixedHeight( 28 ); setContentsMargins( 3, 0, 3, 0 ); m_layout = new QHBoxLayout( this ); setLayout( m_layout ); m_layout->setSpacing( 0 ); m_layout->setContentsMargins( 0, 0, 0, 0 ); BreadcrumbItemButton *rootItem = new BreadcrumbItemButton( KIcon( QPixmap( KStandardDirs::locate( "data", "amarok/images/playlist-sorting-16.png" ) ) ), QString(), this ); rootItem->setToolTip( i18n( "Clear the playlist sorting configuration." ) ); m_layout->addWidget( rootItem ); connect( rootItem, SIGNAL(clicked()), this, SLOT(trimToLevel()) ); m_ribbon = new QHBoxLayout(); m_layout->addLayout( m_ribbon ); m_ribbon->setContentsMargins( 0, 0, 0, 0 ); m_ribbon->setSpacing( 0 ); m_addButton = new BreadcrumbAddMenuButton( this ); m_addButton->setToolTip( i18n( "Add a playlist sorting level." ) ); m_layout->addWidget( m_addButton ); m_layout->addStretch( 10 ); m_urlButton = new BreadcrumbUrlMenuButton( "playlist", this ); m_layout->addWidget( m_urlButton ); connect( m_addButton->menu(), SIGNAL(actionClicked(QString)), this, SLOT(addLevel(QString)) ); connect( m_addButton->menu(), SIGNAL(shuffleActionClicked()), The::playlistActions(), SLOT(shuffle()) ); QString sortPath = Amarok::config( "Playlist Sorting" ).readEntry( "SortPath", QString() ); readSortPath( sortPath ); }
void ToolBar::init() { _menu.setTransparent(true); _menu.setHeight(26); _settings.setTransparent(true); _settings.setHeight(26); _palette.setTransparent(true); _palette.setHeight(26); _about.setTransparent(true); _about.setHeight(26); setFixedHeight(_st.height + _st.shadow_width); _label.setStyleSheet(QString("background:%1;color:#ffffff;").arg(_st.background_color.name())); _label.setFont(QFont(_st.font_family, _st.font_size)); _label.setAlignment(Qt::AlignCenter); _main.setContentsMargins(_st.left_padding, 0, _st.right_padding, _st.bottom_padding); _main.setSpacing(_st.left_padding); if (align() == Align::Ltr) { _main.addWidget(&_menu); _main.addWidget(&_label); _main.addStretch(); _main.addWidget(&_about); _main.addWidget(&_palette); _main.addWidget(&_settings); } else { _main.addWidget(&_settings); _main.addWidget(&_palette); _main.addWidget(&_about); _main.addStretch(); _main.addWidget(&_label); _main.addWidget(&_menu); } }
//----------------------------------------------------------------------------- // Function: DeleteWorkspaceDialog() //----------------------------------------------------------------------------- DeleteWorkspaceDialog::DeleteWorkspaceDialog(QWidget* parent) : QDialog(parent), workspaceCombo_(0), btnOk_(0) { // Create the name label and field. QLabel* nameLabel = new QLabel(tr("Workspace:"), this); workspaceCombo_ = new QComboBox(this); QHBoxLayout* nameLayout = new QHBoxLayout(); nameLayout->addWidget(nameLabel); nameLayout->addWidget(workspaceCombo_, 1); // Create the info label. QLabel* infoLabel = new QLabel(tr("Notice: The default workspace and the currently active workspace cannot be deleted."), this); infoLabel->setWordWrap(true); // Create the dialog buttons. btnOk_ = new QPushButton(tr("OK") , this); btnOk_->setEnabled(false); QPushButton* btnCancel = new QPushButton(tr("Cancel"), this); QHBoxLayout* buttonLayout = new QHBoxLayout(); buttonLayout->addStretch(1); buttonLayout->addWidget(btnOk_); buttonLayout->addWidget(btnCancel); // Create the main mainLayout. QVBoxLayout* mainLayout = new QVBoxLayout(this); mainLayout->addLayout(nameLayout); mainLayout->addWidget(infoLabel); mainLayout->addLayout(buttonLayout); connect(btnOk_, SIGNAL(clicked()), this, SLOT(accept())); connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); setWindowTitle(tr("Delete Workspace")); setFixedWidth(300); setFixedHeight(sizeHint().height()); }
void KstEventMonitorI::fillFieldsForEdit() { EventMonitorEntryPtr ep = kst_cast<EventMonitorEntry>(_dp); if (!ep) { return; // shouldn't be needed } ep->readLock(); _tagName->setText(ep->tagName()); _w->lineEditEquation->setText(ep->event()); _w->lineEditDescription->setText(ep->description()); _w->checkBoxDebug->setChecked(ep->logKstDebug()); _w->checkBoxEMailNotify->setChecked(ep->logEMail()); _w->checkBoxELOGNotify->setChecked(ep->logELOG()); _w->lineEditEMailRecipients->setText(ep->eMailRecipients()); _w->_useScript->setEnabled(!ep->scriptCode().isEmpty()); _w->_script->setText(ep->scriptCode()); switch (ep->level()) { case KstDebug::Notice: _w->radioButtonLogNotice->setChecked(true); break; case KstDebug::Warning: _w->radioButtonLogWarning->setChecked(true); break; case KstDebug::Error: _w->radioButtonLogError->setChecked(true); break; default: _w->radioButtonLogWarning->setChecked(true); break; } ep->unlock(); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
void KstEqDialog::fillFieldsForNew() { KstEquationList eqs; KstVCurveList curves; eqs = kstObjectSubList<KstDataObject, KstEquation>(KST::dataObjectList); curves = kstObjectSubList<KstDataObject, KstVCurve>(KST::dataObjectList); _tagName->setText(defaultTag); _legendText->setText(defaultTag); _legendText->show(); _legendLabel->show(); _w->_curvePlacement->update(); // // set the X Axis Vector to the X axis vector of // the last curve on the global curve list... // if (curves.count() > 0) { _w->_xVectors->setSelection(curves.last()->xVTag().displayString()); } _w->_equation->clear(); // // for some reason the lower widget needs to be shown first to prevent overlapping? // _w->_curveAppearance->hide(); _w->_curvePlacement->show(); _w->_curveAppearance->show(); _w->_curveAppearance->reset(); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
SnapshotShareDialog::SnapshotShareDialog(QString fileName, QWidget* parent) : QDialog(parent), _fileName(fileName), _networkAccessManager(NULL) { setAttribute(Qt::WA_DeleteOnClose); _ui.setupUi(this); QPixmap snaphsotPixmap(fileName); float snapshotRatio = static_cast<float>(snaphsotPixmap.size().width()) / snaphsotPixmap.size().height(); // narrow snapshot if (snapshotRatio > 1) { setFixedWidth(WIDE_SNAPSHOT_DIALOG_WIDTH); _ui.snapshotWidget->setFixedWidth(WIDE_SNAPSHOT_DIALOG_WIDTH); } float labelRatio = static_cast<float>(_ui.snapshotWidget->size().width()) / _ui.snapshotWidget->size().height(); // set the same aspect ratio of label as of snapshot if (snapshotRatio > labelRatio) { int oldHeight = _ui.snapshotWidget->size().height(); _ui.snapshotWidget->setFixedHeight((int) (_ui.snapshotWidget->size().width() / snapshotRatio)); // if height is less then original, resize the window as well if (_ui.snapshotWidget->size().height() < NARROW_SNAPSHOT_DIALOG_SIZE) { setFixedHeight(size().height() - (oldHeight - _ui.snapshotWidget->size().height())); } } else { _ui.snapshotWidget->setFixedWidth((int) (_ui.snapshotWidget->size().height() * snapshotRatio)); } _ui.snapshotWidget->setPixmap(snaphsotPixmap); _ui.snapshotWidget->adjustSize(); }
void KstPsdDialogI::fillFieldsForEdit() { KstPSDPtr pp = kst_cast<KstPSD>(_dp); if (!pp) { return; // shouldn't be needed } pp->readLock(); _tagName->setText(pp->tagName()); _w->_vector->setSelection(pp->vTag()); // set sample rate, Units, FFT len, and vector units _w->_kstFFTOptions->FFTLen->setValue(pp->len()); _w->_kstFFTOptions->SampRate->setText(QString::number(pp->freq())); _w->_kstFFTOptions->VectorUnits->setText(pp->vUnits()); _w->_kstFFTOptions->RateUnits->setText(pp->rUnits()); _w->_kstFFTOptions->Apodize->setChecked(pp->apodize()); _w->_kstFFTOptions->ApodizeFxn->setCurrentItem(pp->apodizeFxn()); _w->_kstFFTOptions->Sigma->setValue(pp->gaussianSigma()); _w->_kstFFTOptions->RemoveMean->setChecked(pp->removeMean()); _w->_kstFFTOptions->Interleaved->setChecked(pp->average()); _w->_kstFFTOptions->Output->setCurrentItem(pp->output()); _w->_kstFFTOptions->InterpolateHoles->setChecked(pp->interpolateHoles()); pp->unlock(); _w->_curveAppearance->hide(); _w->_curvePlacement->hide(); _legendText->hide(); _legendLabel->hide(); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
QConfigurableLoadSaveDialog::QConfigurableLoadSaveDialog(QMap<QString, QConfigurableWidget*> configurableWidgetMap) : configurableWidgetMap(configurableWidgetMap) { function = ConfigurableSave; setFixedHeight(200); setMinimumWidth(300); setLayout(new QVBoxLayout()); setWindowTitle("Select the ConfigurableStates to be saved"); cbFrame_ypos = 0; cbFrame = new QFrame(); cbFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); grid = new QGridLayout(cbFrame); int row = 0; checkBoxConfiguableWidgetList.clear(); foreach(QConfigurableWidget* configurableWidget, configurableWidgetMap) { QCheckBox* cb = new QCheckBox(); cb->setText(configurableWidget->getName()); cb->setCheckState(Qt::Checked); grid->addWidget(cb, row++, 0, Qt::AlignTop); checkBoxConfiguableWidgetList.append(cb); }
KNMainWindowStatusBar::KNMainWindowStatusBar(QWidget *parent) : QWidget(parent), m_backgroundColor(QColor(255, 255, 255)), m_background(QLinearGradient(QPointF(0, 0), knDpi->posF(GradientWidth, 0))), m_mainLayout(new QBoxLayout(QBoxLayout::RightToLeft, this)), m_mouseInOut(generateTimeline()), m_opacity(MinimumOpacity), m_buttonCount(0) { //Set properties. setContentsMargins(0, 0, 0, 0); setFixedWidth(knDpi->width(GradientWidth)); setFixedHeight(knDpi->height(20)); //Initial the background. m_background.setColorAt(0, QColor(0, 0, 0, 0)); //Update the gradient. updateGradient(); //Configure the main layout. m_mainLayout->setContentsMargins( knDpi->margins(GradientWidth, 0, RightSpacing, 0)); m_mainLayout->setSpacing(0); setLayout(m_mainLayout); }
QIMPenSettingsWidget::QIMPenSettingsWidget( QWidget *parent, const char *name ) : QWidget( parent ) { setObjectName( name ); // charSets.setAutoDelete( true ); inputStroke = 0; outputChar = 0; outputStroke = 0; mode = Waiting; currCharSet = 0; readOnly = false; // strokes.setAutoDelete( true ); timer = new QTimer(this); connect( timer, SIGNAL(timeout()), SLOT(timeout())); setBackgroundRole( QPalette::Base ); /* setBackgroundColor( qApp->palette().color( QPalette::Active, QPalette::Base ) ); */ strokeColor = palette().color(QPalette::Text); setFixedHeight( 75 ); }
void KstVvDialogI::fillFieldsForNew() { // set tag name _tagName->setText(defaultTag); _legendText->setText(defaultTag); _legendText->show(); _legendLabel->show(); // set the curve placement window _w->_curvePlacement->update(); // for some reason the lower widget needs to be shown first to prevent overlapping? _w->_curveAppearance->hide(); _w->_curvePlacement->show(); _w->_curveAppearance->show(); _w->_curveAppearance->reset(); QColor qc = _w->_curveAppearance->color(); _w->_curveAppearance->setValue(true, false, false, qc, 0, 0, 0, 0, 0); updateButtons(); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
SearchLineEdit_mac::SearchLineEdit_mac(QWidget* parent) : QWidget(parent) , d(new SearchLineEdit_mac::Private(this)) { QHBoxLayout* layout = new QHBoxLayout(this); layout->addWidget(d); layout->setContentsMargins(4, 5, 2, 2); connect( d, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString)) ); connect( d, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()) ); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); setMinimumSize(sizeHint()); setFixedHeight(sizeHint().height()); }
ProgressDialog::ProgressDialog(QWidget *parent) : QDialog(parent) { resize(Gui::Screen::scaled(220, 100)); setModal(true); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); allowCancel = true; QVBoxLayout *layout = new QVBoxLayout(this); label = new QLabel(this); icon = new QLabel(this); progress = new QProgressBar(this); buttons = new QDialogButtonBox(QDialogButtonBox::Cancel, this); icon->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); progress->setRange(0, 100); QHBoxLayout *row1 = new QHBoxLayout(); row1->addWidget(icon); row1->addWidget(label); layout->addLayout(row1); layout->addWidget(progress); layout->addWidget(buttons); setFixedHeight((sizeHint().height() < 100) ? 100 : sizeHint().height()); #ifdef WINEXTRAS isWinExtras = QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA; if (isWinExtras) { taskbar = new QWinTaskbarButton(this); } #endif connect(buttons, SIGNAL(rejected()), this, SLOT(reject())); }
WindowTitleBar::WindowTitleBar(QWidget *parent) : QWidget(parent), m_Cache (NULL), m_Title (this), m_Minimize(WindowButton::BUTTON_MINIMIZE, this), m_Maximize(WindowButton::BUTTON_MAXIMIZE, this), m_Close (WindowButton::BUTTON_CLOSE , this) { setFixedHeight(33); setAttribute(Qt::WA_TranslucentBackground); m_Title.setStyleSheet("color: white; font-family: Sans; font-weight: bold; font-size: 14px"); UpdateWindowTitle(); connect(&m_Minimize, SIGNAL(clicked ()), this , SLOT (Minimized())); connect(&m_Maximize, SIGNAL(clicked ()), this, SLOT (Maximized())); connect(&m_Close , SIGNAL(clicked ()), this , SLOT (Quit ())); }
/* UIMiniProgressWidget stuff: */ UIMiniProgressWidget::UIMiniProgressWidget(QWidget *pParent /* = 0 */) : QWidget(pParent) , m_pProgressBar(new QProgressBar(this)) , m_pCancelButton(new UIMiniCancelButton(this)) { /* Progress-bar setup: */ m_pProgressBar->setFixedWidth(100); m_pProgressBar->setFormat("%p%"); m_pProgressBar->setValue(0); /* Cancel-button setup: */ m_pCancelButton->setFocusPolicy(Qt::NoFocus); m_pCancelButton->removeBorder(); connect(m_pCancelButton, SIGNAL(clicked()), this, SIGNAL(sigCancel())); setContentsMargins(0, 0, 0, 0); setFixedHeight(16); /* Layout setup: */ QHBoxLayout *pMainLayout = new QHBoxLayout(this); VBoxGlobal::setLayoutMargin(pMainLayout, 0); #ifdef Q_WS_MAC pMainLayout->setSpacing(2); m_pProgressBar->setFixedHeight(14); m_pCancelButton->setFixedHeight(11); pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignTop); pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignBottom); #else /* Q_WS_MAC */ pMainLayout->setSpacing(0); pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignCenter); pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignCenter); #endif /* !Q_WS_MAC */ pMainLayout->addStretch(1); }
MainPage::MainPage( SApplication *parent ) : SPage( tr("Disc Eraser") , parent , SPage::WindowedPage ) { p = new MainPagePrivate; p->device_list = new SDeviceList( this ); p->dst_combo = new SComboBox(); p->dst_combo->setIconSize( QSize(22,22) ); p->toolbar = new QToolBar(); p->toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon ); p->toolbar->setStyleSheet( "QToolBar{ border-style:solid ; margin:0px }" ); p->options_widget = new QWidget(); p->options_ui = new Ui::OptionsUi; p->options_ui->setupUi( p->options_widget ); p->layout = new QVBoxLayout( this ); p->layout->addWidget( p->dst_combo ); p->layout->addWidget( p->options_widget ); p->layout->addWidget( p->toolbar ); p->layout->setContentsMargins( 10 , 10 , 10 , 10 ); setFixedWidth( 373 ); setFixedHeight( EXPANDED_HEIGHT ); p->dst_combo->setCurrentIndex( 0 ); connect( p->device_list , SIGNAL(deviceDetected(SDeviceItem)) , SLOT(deviceDetected(SDeviceItem)) ); p->device_list->refresh(); init_actions(); more_prev(); }
void CSVDoc::Operations::setProgress (int current, int max, int type, int threads) { for (std::vector<Operation *>::iterator iter (mOperations.begin()); iter!=mOperations.end(); ++iter) if ((*iter)->getType()==type) { (*iter)->setProgress (current, max, threads); return; } int oldCount = mOperations.size(); int newCount = oldCount + 1; Operation *operation = new Operation (type, this); connect (operation, SIGNAL (abortOperation (int)), this, SIGNAL (abortOperation (int))); mLayout->addLayout (operation->getLayout()); mOperations.push_back (operation); operation->setProgress (current, max, threads); if ( oldCount > 0) setFixedHeight (height()/oldCount * newCount); setVisible (true); }
LibraryItemView::LibraryItemView(QWidget * parent) : OSDragableView(parent) { setFixedHeight(35); setObjectName("Container"); setHasEmphasis(false); auto mainHBoxLayout = new QHBoxLayout(); mainHBoxLayout->setContentsMargins(5,0,5,0); setLayout(mainHBoxLayout); m_measureTypeBadge = new QLabel(this); m_measureTypeBadge->setFixedSize(25,25); m_measureTypeBadge->setVisible(false); mainHBoxLayout->addWidget(m_measureTypeBadge,Qt::AlignLeft); m_measureBadge = new MeasureBadge(); m_measureBadge->setFixedWidth(25); m_measureBadge->setMeasureBadgeType(MeasureBadgeType::MyMeasure); mainHBoxLayout->addWidget(m_measureBadge,Qt::AlignLeft); label = new QLabel("Measure"); mainHBoxLayout->addWidget(label,Qt::AlignLeft); mainHBoxLayout->addStretch(); errorLabel = new QLabel(); //errorLabel->setPixmap(QPixmap(":/shared_gui_components/images/error-alert.png")); errorLabel->setPixmap(QPixmap(":/shared_gui_components/images/broken_script.png").scaled(24,24)); errorLabel->setFixedSize(24, 24); errorLabel->setVisible(false); mainHBoxLayout->addWidget(errorLabel, Qt::AlignRight); }
/*Конструктор*/ drawerWidget::drawerWidget(QGLFormat fmt, QWidget *parent) : QWidget(parent) { /*Проверка на поддержку пиксельных буферов*/ if(QGLPixelBuffer::hasOpenGLPbuffers()) { pbuffer = new QGLPixelBuffer(512,512,fmt); hasbuffers = true; } else hasbuffers = true; setFixedHeight(350); setFixedWidth(350); viewerPosition[0] = 0.0; viewerPosition[1] = 0.0; viewerPosition[2] = 2.0; lightPosition [0] = 0.0; lightPosition [1] = 3.0; lightPosition [2] = 3.1; lightPosition [3] = 0.0; lightAmbient [0] = 0.0; lightAmbient [1] = 0.0; lightAmbient [2] = 0.0; lightAmbient [3] = 1.0; lightDiffuse [0] = 1.0; lightDiffuse [1] = 1.0; lightDiffuse [2] = 1.0; lightDiffuse [3] = 1.0; lightSpecular [0] = 1.0; lightSpecular [1] = 1.0; lightSpecular [2] = 1.0; lightSpecular [3] = 1.0; }
KstMatrixDialog::KstMatrixDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : KstDataDialog(parent) { _w = new Ui::MatrixDialogWidget(); _w->setupUi(_contents); setMultiple(true); _inTest = false; // xxx _w->_fileName->completionObject()->setDir(QDir::currentPath()); connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(updateEnables())); connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables())); connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(xStartCountFromEndClicked())); connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(yStartCountFromEndClicked())); connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(xNumStepsReadToEndClicked())); connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(yNumStepsReadToEndClicked())); connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(updateEnables())); // xxx _w->_fileName->setMode(KFile::File | KFile::Directory | KFile::ExistingOnly); // xxx connect(_w->_fileName, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(selectFolder())); // xxx connect(_w->_fileName, SIGNAL(textChanged(const QString&)), this, SLOT(updateCompletion())); connect(_w->_configure, SIGNAL(clicked()), this, SLOT(configureSource())); connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(enableSource())); connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables())); connect(_w->_connect, SIGNAL(clicked()), this, SLOT(testURL())); _w->_configure->setEnabled(false); // xxx _fieldCompletion = _w->_field->completionObject(); // xxx _w->_field->setAutoDeleteCompletionObject(true); setFixedHeight(height()); _configWidget = 0L; _w->_field->setEnabled(false); _ok->setEnabled(_w->_field->isEnabled()); // // connections for multiple edit mode... // connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setXStartCountFromEndDirty())); connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setYStartCountFromEndDirty())); connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setXNumStepsReadToEndDirty())); connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setYNumStepsReadToEndDirty())); connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(setDoSkipDirty())); connect(_w->_doAve, SIGNAL(clicked()), this, SLOT(setDoAveDirty())); // // connections for apply button... // // xxx connect(_w->_fileName, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_field, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply())); connect(_w->_configure, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_xStart, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_yStart, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_xNumSteps, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_yNumSteps, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); // xxx connect(_w->_xStart->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); // xxx connect(_w->_yStart->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); // xxx connect(_w->_xNumSteps->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); // xxx connect(_w->_yNumSteps->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_skip, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); // xxx connect(_w->_skip->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_doAve, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_gradientX, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_gradientY, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_gradientZAtMin, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_gradientZAtMax, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_nX, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_nY, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_minX, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_minY, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_xStep, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_yStep, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
MainPage::MainPage( SApplication *parent ) : SPage( tr("Disc Imaging") , parent , SPage::WindowedPage ) { p = new MainPagePrivate; p->device_list = new SDeviceList( this ); p->dst_line = new QLineEdit(); p->dst_line->setReadOnly( true ); p->dst_line->setFixedHeight( 28 ); p->dst_line->setPlaceholderText( tr("Please select a Disc Image") ); p->dst_line->setFocusPolicy( Qt::NoFocus ); p->open_btn = new QToolButton(); p->open_btn->setIcon( SMasterIcons::icon( ICON_SIZE , "document-open.png" ) ); p->open_btn->setFixedSize( 28 , 28 ); p->image_layout = new QHBoxLayout(); p->image_layout->addWidget( p->dst_line ); p->image_layout->addWidget( p->open_btn ); p->src_combo = new SComboBox(); p->src_combo->setIconSize( QSize(22,22) ); p->label = new QLabel(); p->label->setText( tr("To") ); p->toolbar = new QToolBar(); p->toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon ); p->toolbar->setStyleSheet( "QToolBar{ border-style:solid ; margin:0px }" ); p->options_widget = new QWidget(); p->options_ui = new Ui::OptionsUi; p->options_ui->setupUi( p->options_widget ); p->layout = new QVBoxLayout( this ); p->layout->addWidget( p->src_combo ); p->layout->addWidget( p->label ); p->layout->addLayout( p->image_layout ); p->layout->addWidget( p->options_widget ); p->layout->addWidget( p->toolbar ); p->layout->setContentsMargins( 10 , 10 , 10 , 10 ); setFixedWidth( 413 ); setFixedHeight( EXPANDED_HEIGHT ); p->src_combo->setCurrentIndex( 0 ); connect( p->device_list , SIGNAL(deviceDetected(SDeviceItem)) , SLOT(deviceDetected(SDeviceItem)) ); connect( p->open_btn , SIGNAL(clicked()) , SLOT(select_dst_image()) ); connect( p->options_ui->library_check , SIGNAL(toggled(bool)) , p->options_ui->library_widget , SLOT(setVisible(bool)) ); connect( p->options_ui->scan_check , SIGNAL(toggled(bool)) , p->options_ui->scan_widget , SLOT(setVisible(bool)) ); connect( p->options_ui->custom_check , SIGNAL(toggled(bool)) , p->options_ui->custom_widget , SLOT(setVisible(bool)) ); connect( p->options_ui->custom_check , SIGNAL(toggled(bool)) , this , SLOT(setDefaultOptions()) ); connect( p->options_ui->custom_to_spin , SIGNAL(valueChanged(int)) , this , SLOT(to_spin_changed(int)) ); p->options_ui->library_check->setChecked( false ); p->options_ui->scan_check->setChecked( false ); p->options_ui->custom_check->setChecked( false ); init_actions(); more_prev(); p->device_list->refresh(); setAcceptDrops( true ); }
RegExpDialog::RegExpDialog(QWidget *parent) : QDialog(parent) { patternComboBox = new QComboBox; patternComboBox->setEditable(true); patternComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); patternLabel = new QLabel(tr("&Pattern:")); patternLabel->setBuddy(patternComboBox); escapedPatternLineEdit = new QLineEdit; escapedPatternLineEdit->setReadOnly(true); QPalette palette = escapedPatternLineEdit->palette(); palette.setBrush(QPalette::Base, palette.brush(QPalette::Disabled, QPalette::Base)); escapedPatternLineEdit->setPalette(palette); escapedPatternLabel = new QLabel(tr("&Escaped Pattern:")); escapedPatternLabel->setBuddy(escapedPatternLineEdit); syntaxComboBox = new QComboBox; syntaxComboBox->addItem(tr("Regular expression v1"), QRegExp::RegExp); syntaxComboBox->addItem(tr("Regular expression v2"), QRegExp::RegExp2); syntaxComboBox->addItem(tr("Wildcard"), QRegExp::Wildcard); syntaxComboBox->addItem(tr("Fixed string"), QRegExp::FixedString); syntaxComboBox->addItem(tr("W3C Xml Schema 1.1"), QRegExp::W3CXmlSchema11); syntaxLabel = new QLabel(tr("&Pattern Syntax:")); syntaxLabel->setBuddy(syntaxComboBox); textComboBox = new QComboBox; textComboBox->setEditable(true); textComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); textLabel = new QLabel(tr("&Text:")); textLabel->setBuddy(textComboBox); caseSensitiveCheckBox = new QCheckBox(tr("Case &Sensitive")); caseSensitiveCheckBox->setChecked(true); minimalCheckBox = new QCheckBox(tr("&Minimal")); indexLabel = new QLabel(tr("Index of Match:")); indexEdit = new QLineEdit; indexEdit->setReadOnly(true); matchedLengthLabel = new QLabel(tr("Matched Length:")); matchedLengthEdit = new QLineEdit; matchedLengthEdit->setReadOnly(true); for (int i = 0; i < MaxCaptures; ++i) { captureLabels[i] = new QLabel(tr("Capture %1:").arg(i)); captureEdits[i] = new QLineEdit; captureEdits[i]->setReadOnly(true); } captureLabels[0]->setText(tr("Match:")); QHBoxLayout *checkBoxLayout = new QHBoxLayout; checkBoxLayout->addWidget(caseSensitiveCheckBox); checkBoxLayout->addWidget(minimalCheckBox); checkBoxLayout->addStretch(1); QGridLayout *mainLayout = new QGridLayout; mainLayout->addWidget(patternLabel, 0, 0); mainLayout->addWidget(patternComboBox, 0, 1); mainLayout->addWidget(escapedPatternLabel, 1, 0); mainLayout->addWidget(escapedPatternLineEdit, 1, 1); mainLayout->addWidget(syntaxLabel, 2, 0); mainLayout->addWidget(syntaxComboBox, 2, 1); mainLayout->addLayout(checkBoxLayout, 3, 0, 1, 2); mainLayout->addWidget(textLabel, 4, 0); mainLayout->addWidget(textComboBox, 4, 1); mainLayout->addWidget(indexLabel, 5, 0); mainLayout->addWidget(indexEdit, 5, 1); mainLayout->addWidget(matchedLengthLabel, 6, 0); mainLayout->addWidget(matchedLengthEdit, 6, 1); for (int j = 0; j < MaxCaptures; ++j) { mainLayout->addWidget(captureLabels[j], 7 + j, 0); mainLayout->addWidget(captureEdits[j], 7 + j, 1); } setLayout(mainLayout); connect(patternComboBox, SIGNAL(editTextChanged(QString)), this, SLOT(refresh())); connect(textComboBox, SIGNAL(editTextChanged(QString)), this, SLOT(refresh())); connect(caseSensitiveCheckBox, SIGNAL(toggled(bool)), this, SLOT(refresh())); connect(minimalCheckBox, SIGNAL(toggled(bool)), this, SLOT(refresh())); connect(syntaxComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(refresh())); patternComboBox->addItem(tr("[A-Za-z_]+([A-Za-z_0-9]*)")); textComboBox->addItem(tr("(10 + delta4) * 32")); setWindowTitle(tr("RegExp")); setFixedHeight(sizeHint().height()); refresh(); }
void ExpandingLabel::allTextVisible() { QTextDocument *doc = document(); doc->setTextWidth(width()); int height = doc->documentLayout()->documentSize().toSize().height(); setFixedHeight(height); }
listMemberDialog::listMemberDialog(QWidget *parent,QString classId) { conn = database::connectByC(); QVBoxLayout *topLeftLayout = new QVBoxLayout; view = new QTableView(this); model = new QStandardItemModel(this); view->setModel(model); model->setHorizontalHeaderItem(0, new QStandardItem(tr("ID"))); model->setHorizontalHeaderItem(1, new QStandardItem(tr("Name"))); model->setHorizontalHeaderItem(2, new QStandardItem(tr("Birth year"))); model->setHorizontalHeaderItem(3, new QStandardItem(tr("Note"))); model->setHorizontalHeaderItem(4, new QStandardItem(tr("-"))); view->setColumnWidth(0,20); view->setColumnWidth(1,90); view->setColumnWidth(2,57); view->setColumnWidth(3,40); view->setColumnWidth(4,30); label = new QLabel("Member list"); topLeftLayout->addWidget(label); int rowCurrent = 0; MYSQL_RES *res = database::classMember_searchClassId(conn,classId); while(MYSQL_ROW classMemberRow = mysql_fetch_row(res)) { QString memberId = classMemberRow[1]; MYSQL_ROW memberRow = database::member_searchMemberId(conn,memberId); model->setItem(rowCurrent, 0, new QStandardItem(memberRow[0])); model->setItem(rowCurrent, 1, new QStandardItem(memberRow[1])); model->setItem(rowCurrent, 2, new QStandardItem(memberRow[2])); model->setItem(rowCurrent, 3, new QStandardItem(memberRow[3])); QPushButton *button = new QPushButton(""); QPixmap pixmap("Resources/Delete_icon.png"); QIcon buttonIcon(pixmap); button->setIcon(buttonIcon); QSignalMapper *signalMapper = new QSignalMapper(this); signalMapper->setMapping(button,memberId); QObject::connect(button,SIGNAL(clicked()),signalMapper,SLOT(map())); QObject::connect(signalMapper,SIGNAL(mapped(QString)),this,SLOT(deleteMemberAction(QString))); view->setIndexWidget(model->index(rowCurrent,4),button); rowCurrent++; } numOldMemberInDialog = rowCurrent; topLeftLayout->addWidget(view); QHBoxLayout *horizontalLayout = new QHBoxLayout(); QPushButton *saveButton = new QPushButton("Save"); QPixmap pixmap1("Resources/save_icon.png"); QIcon ButtonIcon1(pixmap1); saveButton->setIcon(ButtonIcon1); QSignalMapper *saveMapper = new QSignalMapper(this); saveMapper->setMapping(saveButton,classId); QObject::connect(saveButton,SIGNAL(clicked()),saveMapper,SLOT(map())); QObject::connect(saveMapper,SIGNAL(mapped(QString)),this,SLOT(saveListAction(QString))); horizontalLayout->addWidget(saveButton); QPushButton *addMemberButton = new QPushButton("Add Member"); QPixmap pixmap("Resources/add-icon.png"); QIcon ButtonIcon(pixmap); addMemberButton->setIcon(ButtonIcon); QObject::connect(addMemberButton,SIGNAL(clicked()),this,SLOT(addMemberAction())); horizontalLayout->addWidget(addMemberButton); setLayout(topLeftLayout); topLeftLayout->addLayout(horizontalLayout); setWindowTitle(tr("Member list")); setFixedHeight(sizeHint().height()); }
KNAccountRegisterPanel::KNAccountRegisterPanel(QWidget *parent) : QWidget(parent), m_validColor(QColor(0x41, 0x92, 0x57)), m_invalidColor(QColor(0x9a, 0x25, 0x38)), m_emptyColor(QColor(0x9D, 0x9D, 0x9D)), m_title(new QLabel(this)), m_emailHint(new QLabel(this)), m_errorHint(new QLabel(this)), m_agreeLicense(new QCheckBox(this)), m_username(new KNLabelLineEdit(this)), m_password(new KNLabelLineEdit(this)), m_email(new KNLabelLineEdit(this)), m_okay(generateButton("://public/ok.png")), m_cancel(generateButton("://public/cancel.png")), m_errorCode(-1) { //Set properties. setFixedHeight(knDpi->height(270)); //Configure the title label. m_title->setAlignment(Qt::AlignCenter); QFont titleFont=m_title->font(); titleFont.setPixelSize(knDpi->height(18)); m_title->setFont(titleFont); //Configure the user name line edit. m_username->setMinimumLightness(0xC0); m_username->setMediumLightness(0xE0); m_username->setLabelIcon(QPixmap("://public/generate_username.png")); connect(m_username, &KNLabelLineEdit::textChanged, this, &KNAccountRegisterPanel::onActionCheckValid); //Configure password line edit. m_password->setMinimumLightness(0xC0); m_password->setMediumLightness(0xE0); m_password->setLabelIcon(QPixmap("://public/generate_password.png")); m_password->setEchoMode(QLineEdit::Password); connect(m_password, &KNLabelLineEdit::textChanged, this, &KNAccountRegisterPanel::onActionCheckValid); //Configure the E-mail. m_email->setMinimumLightness(0xC0); m_email->setMediumLightness(0xE0); m_email->setLabelIcon(QPixmap("://public/generate_email.png")); connect(m_email, &KNLabelLineEdit::textChanged, this, &KNAccountRegisterPanel::onActionCheckValid); //Configure the check box. connect(m_agreeLicense, &QCheckBox::stateChanged, this, &KNAccountRegisterPanel::onActionCheckValid); //Configure the hint label. QPalette hintPal=palette(); hintPal.setColor(QPalette::WindowText, QColor(157, 157, 157)); // E-mail Hint. m_emailHint->setPalette(hintPal); m_emailHint->setContentsMargins(knDpi->margins(5, 0, 0, 0)); // Error Hint. m_errorHint->setAlignment(Qt::AlignCenter); // Error Hint. QPalette errorPal=m_errorHint->palette(); errorPal.setColor(QPalette::WindowText, QColor(0x9a, 0x25, 0x38)); m_errorHint->setPalette(errorPal); //Okay buttons. m_okay->hide(); //Connect buttons. connect(m_okay, SIGNAL(clicked(bool)), this, SIGNAL(requireRegister())); connect(m_cancel, SIGNAL(clicked(bool)), this, SLOT(onActionCancel())); //Initial the box layout. QBoxLayout *mainLayout=new QBoxLayout(QBoxLayout::TopToBottom, this); mainLayout->setSpacing(0); setLayout(mainLayout); //Add widget to layout mainLayout->addSpacing(knDpi->height(7)); mainLayout->addWidget(m_title); mainLayout->addSpacing(knDpi->height(3)); mainLayout->addWidget(m_errorHint); mainLayout->addSpacing(knDpi->height(3)); mainLayout->addWidget(m_username); mainLayout->addSpacing(knDpi->height(3)); mainLayout->addWidget(m_password); mainLayout->addSpacing(knDpi->height(2)); //Generate the label palette. QPalette labelPalette=palette(); labelPalette.setColor(QPalette::WindowText, m_emptyColor); //Initial the hint label. for(int i=0; i<PasswordHintTypeCount; ++i) { //Initial the password hint. m_passwordHint[i]=new QLabel(this); //Set porperties. m_passwordHint[i]->setContentsMargins(5, 0, 0, 0); m_passwordHint[i]->setWordWrap(true); //Set the palette. m_passwordHint[i]->setPalette(labelPalette); //Add hint to main layout. mainLayout->addWidget(m_passwordHint[i]); } mainLayout->addSpacing(knDpi->height(5)); mainLayout->addWidget(m_email); mainLayout->addSpacing(knDpi->height(2)); mainLayout->addWidget(m_emailHint); mainLayout->addSpacing(knDpi->height(3)); mainLayout->addWidget(m_agreeLicense, 0, Qt::AlignHCenter); mainLayout->addSpacing(knDpi->height(1)); //Initial button layout. QBoxLayout *buttonLayout=new QBoxLayout(QBoxLayout::LeftToRight, mainLayout->widget()); buttonLayout->setContentsMargins(knDpi->margins(1,3,1,3)); mainLayout->addLayout(buttonLayout); mainLayout->addStretch(); //Add all buttons. buttonLayout->addWidget(m_okay); buttonLayout->addWidget(m_cancel); //Link the retranslator. knI18n->link(this, &KNAccountRegisterPanel::retranslate); retranslate(); }
GcScopeBar::GcScopeBar(Context *context, QWidget *traintool) : QWidget(context->mainWindow), context(context) { setFixedHeight(23); setContentsMargins(10,0,10,0); layout = new QHBoxLayout(this); layout->setSpacing(2); layout->setContentsMargins(0,0,0,0); searchLabel = new GcLabel(tr("Search/Filter:")); searchLabel->setYOff(1); searchLabel->setFixedHeight(20); searchLabel->setHighlighted(true); QFont font; #ifdef Q_OS_MAC font.setFamily("Lucida Grande"); #else font.setFamily("Helvetica"); #endif #ifdef WIN32 font.setPointSize(8); #else font.setPointSize(10); #endif font.setWeight(QFont::Black); searchLabel->setFont(font); layout->addWidget(searchLabel); searchLabel->hide(); #ifdef GC_HAVE_LUCENE connect(context->mainWindow, SIGNAL(filterChanged(QStringList&)), this, SLOT(setHighlighted())); #endif // Mac uses QtMacButton - recessed etc #ifdef Q_OS_MAC home = new QtMacButton(this, QtMacButton::Recessed); #ifdef GC_HAVE_ICAL diary = new QtMacButton(this, QtMacButton::Recessed); #endif anal = new QtMacButton(this, QtMacButton::Recessed); train = new QtMacButton(this, QtMacButton::Recessed); #else // Windows / Linux uses GcScopeButton - pushbutton home = new GcScopeButton(this); #ifdef GC_HAVE_ICAL diary = new GcScopeButton(this); #endif anal = new GcScopeButton(this); train = new GcScopeButton(this); #endif // now set the text for each one home->setText(tr("Home")); layout->addWidget(home); connect(home, SIGNAL(clicked(bool)), this, SLOT(clickedHome())); #ifdef GC_HAVE_ICAL diary->setText(tr("Diary")); layout->addWidget(diary); connect(diary, SIGNAL(clicked(bool)), this, SLOT(clickedDiary())); #endif anal->setText(tr("Analysis")); anal->setWidth(70); anal->setChecked(true); layout->addWidget(anal); connect(anal, SIGNAL(clicked(bool)), this, SLOT(clickedAnal())); train->setText(tr("Train")); layout->addWidget(train); connect(train, SIGNAL(clicked(bool)), this, SLOT(clickedTrain())); layout->addStretch(); layout->addWidget(traintool); layout->addStretch(); // we now need to adjust the buttons according to their text size // this is particularly bad for German's who, as a nation, must // suffer from RSI from typing and writing more than any other nation ;) QFontMetrics fontMetric(font); int width = fontMetric.width(tr("Home")); home->setWidth(width+20); width = fontMetric.width(tr("Analysis")); anal->setWidth(width+20); width = fontMetric.width(tr("Train")); train->setWidth(width+20); #ifdef GC_HAVE_ICAL width = fontMetric.width(tr("Diary")); diary->setWidth(width+20); #endif }
/** * Updates the fixed height. Called when the tab height or the number of rows * changed. */ void KTinyTabBar::updateFixedHeight() { setFixedHeight( numRows() * tabHeight() ); triggerResizeEvent(); }