NewGameView::NewGameView( QWidget *parent ) : QWidget( parent ) { QBoxLayout *topLayout = new QVBoxLayout( this ); topLayout->setSpacing( 8 ); topLayout->setMargin( 8 ); topLayout->addStretch( 1 ); m_timesTableCheck = new QCheckBox( i18n("Times Table"), this ); topLayout->addWidget( m_timesTableCheck ); m_timesTableCheck->setChecked( true ); topLayout->addLayout( createRowChecks( m_multiplicationRowChecks ) ); m_divisionCheck = new QCheckBox( i18n("Division"), this ); topLayout->addWidget( m_divisionCheck ); topLayout->addLayout( createRowChecks( m_divisionRowChecks ) ); m_squareNumbersCheck = new QCheckBox( i18n("Square Numbers"), this ); topLayout->addWidget( m_squareNumbersCheck ); m_cubicNumbersCheck = new QCheckBox( i18n("Cubic Numbers"), this ); topLayout->addWidget( m_cubicNumbersCheck ); topLayout->addStretch( 1 ); QPushButton *startButton = new QPushButton( i18n("Start"), this ); topLayout->addWidget( startButton ); connect( startButton, SIGNAL( clicked() ), SLOT( slotStartClicked() ) ); topLayout->addStretch( 1 ); }
void GNumericalExpression::PopulateDeviceWidget(GDeviceWidget* theDeviceWidget) { QBoxLayout* pDeviceLayout = new QVBoxLayout(); theDeviceWidget->AddSubLayout(pDeviceLayout); pDeviceLayout->setContentsMargins(1, 1, 1, 1); pDeviceLayout->setSpacing(1); QBoxLayout* pVariablesAndValueLayout = new QHBoxLayout(); QBoxLayout* pExpressionLayout = new QVBoxLayout(); pExpressionLayout->addWidget(m_Expression.ProvideNewParamLineEdit(theDeviceWidget)); pExpressionLayout->addWidget(m_Expression.ProvideNewLabel(theDeviceWidget)); pVariablesAndValueLayout->addWidget(m_VariableBucket.ProvideNewParamWidget(theDeviceWidget)); pVariablesAndValueLayout->addWidget(m_ValueBucket.ProvideNewParamWidget(theDeviceWidget)); // QPushButton* pSettingsButton = new QPushButton("Settings"); // GNumericalExpressionSettingsWidget* pSettingsWindow = new GNumericalExpressionSettingsWidget(this); // connect(pSettingsButton, SIGNAL(clicked(bool)), pSettingsWindow, SLOT(show())); // pVariablesAndValueLayout->insertWidget(1, pSettingsButton); pDeviceLayout->addLayout(pExpressionLayout); pDeviceLayout->addLayout(pVariablesAndValueLayout); pDeviceLayout->addStretch(); }
OdtDialog::OdtDialog(bool update, bool prefix, bool pack) : QDialog(0) { setModal(true); setWindowIcon(QIcon(IconManager::instance()->loadIcon ( "AppIcon.png" ))); setWindowTitle( tr("OpenDocument Importer Options")); QBoxLayout* layout = new QVBoxLayout(this); layout->setMargin(0); layout->setSpacing(0); QBoxLayout* hlayout = new QHBoxLayout; hlayout->setMargin(5); hlayout->setSpacing(5); updateCheck = new QCheckBox( tr("Overwrite Paragraph Styles"), this); updateCheck->setChecked(update); updateCheck->setToolTip( "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>"); hlayout->addWidget(updateCheck); layout->addLayout(hlayout); QBoxLayout* palayout = new QHBoxLayout; palayout->setMargin(5); palayout->setSpacing(5); packCheck = new QCheckBox( tr("Merge Paragraph Styles"), this); packCheck->setChecked(pack); packCheck->setToolTip( "<qt>" + tr("Merge paragraph styles by attributes. This will result in fewer similar paragraph styles, will retain style attributes, even if the original document's styles are named differently.") +"</qt>"); palayout->addWidget(packCheck); layout->addLayout(palayout); QBoxLayout* playout = new QHBoxLayout; playout->setMargin(5); playout->setSpacing(5); prefixCheck = new QCheckBox( tr("Use document name as a prefix for paragraph styles"), this); prefixCheck->setChecked(prefix); prefixCheck->setToolTip( "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus") +"</qt>"); playout->addWidget(prefixCheck); layout->addLayout(playout); QBoxLayout* dlayout = new QHBoxLayout; dlayout->setMargin(5); dlayout->setSpacing(5); doNotAskCheck = new QCheckBox( tr("Do not ask again"), this); doNotAskCheck->setChecked(false); doNotAskCheck->setToolTip( "<qt>" + tr("Make these settings the default and do not prompt again when importing an OASIS OpenDocument") +"</qt>"); //dlayout->addStretch(10); dlayout->addWidget(doNotAskCheck); layout->addLayout(dlayout); QBoxLayout* blayout = new QHBoxLayout; blayout->setMargin(5); blayout->setSpacing(5); blayout->addStretch(10); okButton = new QPushButton( tr("OK"), this); blayout->addWidget(okButton); cancelButton = new QPushButton( tr("Cancel"), this); blayout->addWidget(cancelButton); layout->addLayout(blayout); connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); }
QtContactEditWindow::QtContactEditWindow() : contactEditWidget_(NULL) { resize(300,300); setWindowTitle(tr("Edit contact")); setContentsMargins(0,0,0,0); QBoxLayout* layout = new QVBoxLayout(this); jidLabel_ = new QLabel(this); jidLabel_->setAlignment(Qt::AlignHCenter); layout->addWidget(jidLabel_); groupsLayout_ = new QVBoxLayout(); groupsLayout_->setContentsMargins(0,0,0,0); layout->addLayout(groupsLayout_); QHBoxLayout* buttonLayout = new QHBoxLayout(); layout->addLayout(buttonLayout); QPushButton* removeButton = new QPushButton(tr("Remove contact"), this); connect(removeButton, SIGNAL(clicked()), this, SLOT(handleRemoveContact())); buttonLayout->addWidget(removeButton); QPushButton* okButton = new QPushButton(tr("OK"), this); connect(okButton, SIGNAL(clicked()), this, SLOT(handleUpdateContact())); buttonLayout->addStretch(); buttonLayout->addWidget(okButton); }
QmitkNewSegmentationDialog::QmitkNewSegmentationDialog(QWidget* parent) :QDialog(parent), // true, modal selectedOrgan("undefined"), newOrganEntry(false) { QDialog::setFixedSize(250, 105); QBoxLayout * verticalLayout = new QVBoxLayout( this ); verticalLayout->setMargin(5); verticalLayout->setSpacing(5); mitk::OrganTypeProperty::Pointer organTypes = mitk::OrganTypeProperty::New(); // to enter a name for the segmentation lblPrompt = new QLabel( "Name and color of the segmentation", this ); verticalLayout->addWidget( lblPrompt ); // to choose a color btnColor = new QPushButton( "", this ); btnColor->setFixedWidth(25); btnColor->setAutoFillBackground(true); btnColor->setStyleSheet("background-color:rgb(255,0,0)"); connect( btnColor, SIGNAL(clicked()), this, SLOT(onColorBtnClicked()) ); edtName = new QLineEdit( "", this ); QStringList completionList; completionList << ""; completer = new QCompleter(completionList); completer->setCaseSensitivity(Qt::CaseInsensitive); edtName->setCompleter(completer); connect( completer, SIGNAL(activated(const QString&)), this, SLOT(onColorChange(const QString&)) ); QBoxLayout * horizontalLayout2 = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout2); horizontalLayout2->addWidget( btnColor ); horizontalLayout2->addWidget( edtName ); //buttons for closing the dialog btnOk = new QPushButton( tr("Ok"), this ); btnOk->setDefault(true); connect( btnOk, SIGNAL(clicked()), this, SLOT(onAcceptClicked()) ); QPushButton* btnCancel = new QPushButton( tr("Cancel"), this ); connect( btnCancel, SIGNAL(clicked()), this, SLOT(reject()) ); QBoxLayout * horizontalLayout = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout); horizontalLayout->setSpacing(5); horizontalLayout->addStretch(); horizontalLayout->addWidget( btnOk ); horizontalLayout->addWidget( btnCancel ); edtName->setFocus(); }
AddresseeDialog::AddresseeDialog(QWidget *parent, bool multiple) : KDialogBase(KDialogBase::Plain, i18n("Select Addressee"), Ok | Cancel, Ok, parent), mMultiple(multiple) { QWidget *topWidget = plainPage(); QBoxLayout *topLayout = new QHBoxLayout(topWidget); QBoxLayout *listLayout = new QVBoxLayout; topLayout->addLayout(listLayout); mAddresseeList = new KListView(topWidget); mAddresseeList->addColumn(i18n("Name")); mAddresseeList->addColumn(i18n("Email")); mAddresseeList->setAllColumnsShowFocus(true); mAddresseeList->setFullWidth(true); listLayout->addWidget(mAddresseeList); connect(mAddresseeList, SIGNAL(doubleClicked(QListViewItem *)), SLOT(slotOk())); connect(mAddresseeList, SIGNAL(selectionChanged(QListViewItem *)), SLOT(updateEdit(QListViewItem *))); mAddresseeEdit = new KLineEdit(topWidget); mAddresseeEdit->setCompletionMode(KGlobalSettings::CompletionAuto); connect(mAddresseeEdit->completionObject(), SIGNAL(match(const QString &)), SLOT(selectItem(const QString &))); mAddresseeEdit->setFocus(); mAddresseeEdit->completionObject()->setIgnoreCase(true); listLayout->addWidget(mAddresseeEdit); setInitialSize(QSize(450, 300)); if(mMultiple) { QBoxLayout *selectedLayout = new QVBoxLayout; topLayout->addLayout(selectedLayout); topLayout->setSpacing(spacingHint()); QGroupBox *selectedGroup = new QGroupBox(1, Horizontal, i18n("Selected"), topWidget); selectedLayout->addWidget(selectedGroup); mSelectedList = new KListView(selectedGroup); mSelectedList->addColumn(i18n("Name")); mSelectedList->addColumn(i18n("Email")); mSelectedList->setAllColumnsShowFocus(true); mSelectedList->setFullWidth(true); connect(mSelectedList, SIGNAL(doubleClicked(QListViewItem *)), SLOT(removeSelected())); QPushButton *unselectButton = new QPushButton(i18n("Unselect"), selectedGroup); connect(unselectButton, SIGNAL(clicked()), SLOT(removeSelected())); connect(mAddresseeList, SIGNAL(clicked(QListViewItem *)), SLOT(addSelected(QListViewItem *))); setInitialSize(QSize(650, 350)); } mAddressBook = StdAddressBook::self(true); connect(mAddressBook, SIGNAL(addressBookChanged(AddressBook *)), SLOT(addressBookChanged())); connect(mAddressBook, SIGNAL(loadingFinished(Resource *)), SLOT(addressBookChanged())); loadAddressBook(); }
BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation) : m_contentWidget(new QWidget), m_errorIcon(new QLabel), m_warningIcon(new QLabel), m_errorLabel(new QLabel), m_warningLabel(new QLabel), m_taskWindow(taskWindow) { QHBoxLayout *contentLayout = new QHBoxLayout; contentLayout->setContentsMargins(0, 0, 0, 0); contentLayout->setSpacing(0); setLayout(contentLayout); contentLayout->addWidget(m_contentWidget); QBoxLayout *layout; if (orientation == Qt::Horizontal) layout = new QHBoxLayout; else layout = new QVBoxLayout; layout->setContentsMargins(8, 2, 0, 2); layout->setSpacing(2); m_contentWidget->setLayout(layout); QHBoxLayout *errorLayout = new QHBoxLayout; errorLayout->setSpacing(2); layout->addLayout(errorLayout); errorLayout->addWidget(m_errorIcon); errorLayout->addWidget(m_errorLabel); QHBoxLayout *warningLayout = new QHBoxLayout; warningLayout->setSpacing(2); layout->addLayout(warningLayout); warningLayout->addWidget(m_warningIcon); warningLayout->addWidget(m_warningLabel); // ### TODO this setup should be done by style QFont f = this->font(); f.setPointSizeF(Utils::StyleHelper::sidebarFontSize()); f.setBold(true); m_errorLabel->setFont(f); m_warningLabel->setFont(f); m_errorLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_errorLabel->palette())); m_warningLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_warningLabel->palette())); m_errorIcon->setAlignment(Qt::AlignRight); m_warningIcon->setAlignment(Qt::AlignRight); m_errorIcon->setPixmap(QPixmap(Utils::StyleHelper::dpiSpecificImageFile( QLatin1String(Core::Constants::ICON_ERROR)))); m_warningIcon->setPixmap(QPixmap(Utils::StyleHelper::dpiSpecificImageFile( QLatin1String(Core::Constants::ICON_WARNING)))); m_contentWidget->hide(); connect(m_taskWindow, SIGNAL(tasksChanged()), this, SLOT(updateState())); }
BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation) : m_contentWidget(new QWidget), m_errorIcon(new QLabel), m_warningIcon(new QLabel), m_errorLabel(new QLabel), m_warningLabel(new QLabel), m_taskWindow(taskWindow) { auto contentLayout = new QHBoxLayout; contentLayout->setContentsMargins(0, 0, 0, 0); contentLayout->setSpacing(0); setLayout(contentLayout); contentLayout->addWidget(m_contentWidget); QBoxLayout *layout; if (orientation == Qt::Horizontal) layout = new QHBoxLayout; else layout = new QVBoxLayout; layout->setContentsMargins(8, 2, 0, 2); layout->setSpacing(2); m_contentWidget->setLayout(layout); auto errorLayout = new QHBoxLayout; errorLayout->setSpacing(2); layout->addLayout(errorLayout); errorLayout->addWidget(m_errorIcon); errorLayout->addWidget(m_errorLabel); auto warningLayout = new QHBoxLayout; warningLayout->setSpacing(2); layout->addLayout(warningLayout); warningLayout->addWidget(m_warningIcon); warningLayout->addWidget(m_warningLabel); // ### TODO this setup should be done by style QFont f = this->font(); f.setPointSizeF(Utils::StyleHelper::sidebarFontSize()); f.setBold(true); m_errorLabel->setFont(f); m_warningLabel->setFont(f); m_errorLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_errorLabel->palette())); m_warningLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_warningLabel->palette())); m_errorLabel->setProperty("_q_custom_style_disabled", QVariant(true)); m_warningLabel->setProperty("_q_custom_style_disabled", QVariant(true)); m_errorIcon->setAlignment(Qt::AlignRight); m_warningIcon->setAlignment(Qt::AlignRight); m_errorIcon->setPixmap(Utils::Icons::CRITICAL_TOOLBAR.pixmap()); m_warningIcon->setPixmap(Utils::Icons::WARNING_TOOLBAR.pixmap()); m_contentWidget->hide(); connect(m_taskWindow.data(), &TaskWindow::tasksChanged, this, &BuildProgress::updateState); }
NHypersurfaceCreator::NHypersurfaceCreator() { // Set up the basic layout. ui = new QWidget(); QBoxLayout* layout = new QVBoxLayout(ui); QBoxLayout* coordArea = new QHBoxLayout(); layout->addLayout(coordArea); QString expln = ui->tr("Specifies the coordinate system in which the " "normal hypersurfaces will be enumerated."); QLabel* label = new QLabel(ui->tr("Coordinate system:"), ui); label->setWhatsThis(expln); coordArea->addWidget(label); coords = new HyperCoordinateChooser(); coords->insertAllCreators(); coords->setCurrentSystem( ReginaPrefSet::global().hypersurfacesCreationCoords); coords->setWhatsThis(expln); coordArea->addWidget(coords, 1); QBoxLayout* basisArea = new QHBoxLayout(); layout->addLayout(basisArea); expln = ui->tr("<qt>Specifies whether to enumerate only " "vertex hypersurfaces (at extremal rays of the normal hypersurface " "solution cone), or all fundamental surfaces (which form a Hilbert " "basis for the solution cone).<p>Fundamental surfaces are " "more numerous, and can be significantly slower to enumerate.</qt>"); label = new QLabel(ui->tr("Enumerate:"), ui); label->setWhatsThis(expln); basisArea->addWidget(label); basis = new QComboBox(ui); // These insertions MUST happen in the same order in which the // BASIS_... constants are defined at the top of this file. basis->insertItem(BASIS_VERTEX, ui->tr("Vertex hypersurfaces")); basis->insertItem(BASIS_FUND, ui->tr("Fundamental hypersurfaces")); basis->setCurrentIndex( ReginaPrefSet::global().hypersurfacesCreationList.has( regina::HS_FUNDAMENTAL) ? BASIS_FUND : BASIS_VERTEX); basis->setWhatsThis(expln); basisArea->addWidget(basis, 1); embedded = new QCheckBox(ui->tr("Embedded hypersurfaces only"), ui); embedded->setChecked( ! ReginaPrefSet::global().hypersurfacesCreationList.has( regina::HS_IMMERSED_SINGULAR)); embedded->setWhatsThis(ui->tr("Specifies whether only embedded " "normal hypersurfaces should be enumerated, or whether all normal " "hypersurfaces (embedded, immersed and singular) should be " "enumerated.")); layout->addWidget(embedded); }
setTransformDialog::setTransformDialog(QWidget *parent) : QDialog(parent) { QBoxLayout *layout = new QVBoxLayout; QBoxLayout *layout1 = new QHBoxLayout; QBoxLayout *layout2 = new QHBoxLayout; QBoxLayout *layout3 = new QHBoxLayout; QBoxLayout *layout4 = new QHBoxLayout; label_Root = new QLabel("Root Tile:"); label_Width = new QLabel("Image Width:"); label_Height = new QLabel("Image Height:"); Edit_Root = new QLineEdit; Edit_Width = new QLineEdit; Edit_Height = new QLineEdit; Edit_Root->setValidator(new QDoubleValidator(0.0, 10000.0, 3, Edit_Root)); Edit_Width->setValidator(new QDoubleValidator(0.0, 10000.0, 3, Edit_Width)); Edit_Height->setValidator(new QDoubleValidator(0.0, 10000.0, 3, Edit_Height)); okButton = new QPushButton("Ok", this); cancelButton = new QPushButton("Cancel", this); connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); layout1->addWidget(label_Root); layout1->addWidget(Edit_Root); layout2->addWidget(label_Width); layout2->addWidget(Edit_Width); layout3->addWidget(label_Height); layout3->addWidget(Edit_Height); layout4->addWidget(okButton); layout4->addWidget(cancelButton); layout->addLayout(layout1); layout->addLayout(layout2); layout->addLayout(layout3); layout->addLayout(layout4); Root = 0; Width = 0; Height = 0; setLayout(layout); }
gtImporterDialog::gtImporterDialog(const QStringList& importers, int currentSelection) { setWindowTitle( tr("Choose the importer to use")); setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png")); QBoxLayout* layout = new QVBoxLayout(this); QBoxLayout* llayout = new QHBoxLayout; llayout->setMargin(5); llayout->setSpacing(5); QLabel* label = new QLabel( tr("Choose the importer to use"), this); llayout->addWidget(label); layout->addLayout(llayout); QBoxLayout* ilayout = new QHBoxLayout; ilayout->setMargin(5); ilayout->setSpacing(5); importerCombo = new ScComboBox(this); importerCombo->setMinimumSize(QSize(150, 0)); importerCombo->setToolTip( tr("Choose the importer to use")); importerCombo->addItems(importers); if (static_cast<int>(importers.count()) > currentSelection) importerCombo->setCurrentIndex(currentSelection); else importerCombo->setCurrentIndex(0); ilayout->addWidget(importerCombo); layout->addLayout(ilayout); QBoxLayout* dlayout = new QHBoxLayout; dlayout->setMargin(5); dlayout->setSpacing(5); rememberCheck = new QCheckBox( tr("Remember association"), this); rememberCheck->setChecked(false); rememberCheck->setToolTip( "<qt>" + tr("Remember the file extension - importer association and do not ask again to select an importer for files of this type.") + "</qt>" ); dlayout->addStretch(10); dlayout->addWidget(rememberCheck); layout->addLayout(dlayout); QBoxLayout* blayout = new QHBoxLayout; blayout->setMargin(5); blayout->setSpacing(5); blayout->addStretch(10); okButton = new QPushButton( CommonStrings::tr_OK, this); blayout->addWidget(okButton); layout->addLayout(blayout); connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); }
void SurveyEditorGeneratorPage::setupUi() { QBoxLayout * vlayout = new QVBoxLayout(); QBoxLayout * infolayout = new QVBoxLayout(); QBoxLayout * hlayout = new QHBoxLayout(); QToolBar * toolbar = new QToolBar(this); toolbar->setIconSize( QSize(48,48) ); toolbar->addAction(QIcon(global::R.getValue("icon/scripteditorrun")), tr("Run Script"), this,SLOT(onActionRunScript())); Overlay * o =mScriptView->overlay(); o->setMovie( new QMovie( global::R.getValue("animation/loading") )); o->movie()->start(); o->hide(); mDescriptionEdit = new PlainTextEdit(this); mDescriptionEdit->overlay()->setText( tr("Description") ); mDescriptionEdit->setToolTip( mDescriptionEdit->overlay()->text() ); mDescriptionEdit->setReadOnly(true); mAuthorEdit = new LineEdit(this); mAuthorEdit->overlay()->setText( tr("Author") ); mAuthorEdit->setToolTip( mAuthorEdit->overlay()->text() ); mAuthorEdit->setReadOnly(true); mVersionEdit = new LineEdit(this); mVersionEdit->overlay()->setText( tr("Version") ); mVersionEdit->setToolTip( mVersionEdit->overlay()->text() ); mVersionEdit->setReadOnly(true); vlayout->addWidget(toolbar); hlayout->addWidget(mScriptView); infolayout->addWidget(mDescriptionEdit); infolayout->addWidget(mAuthorEdit); infolayout->addWidget(mVersionEdit); infolayout->addStretch(); hlayout->addLayout(infolayout); vlayout->addLayout(hlayout); setLayout(vlayout); updateScriptList(); }
KarmadromeConfigDialog::KarmadromeConfigDialog( QWidget *parent, Qt::WindowFlags flags ) : QDialog( parent, flags ) , mpGlobalConfigWidget( new GlobalConfigWidget( this ) ) , mpNumColumnsLabel( new QLabel( tr("Number Of Columns"), this ) ) , mpNumColumns( new QSpinBox( this ) ) , mpClearBeforeImport( new QCheckBox( tr("Clear Group Before Import"), this ) ) , mpExportAsRelative( new QCheckBox( tr("Export m3u With Relative Entries"), this ) ) , mpRandomizeExport( new QCheckBox( tr("Randomize Output Of Export m3u"), this ) ) , mpUseCheckBoxes( new QCheckBox( tr("Use Checkboxes Instead Of Buttons For Groups"), this ) ) { setWindowTitle( QApplication::applicationName() + ": " + tr("Settings") ); setWindowIcon( QIcon( ":/Karmadrome/Icon.png" ) ); mpNumColumns->setRange( 1, 9 ); AboutWidget *about = new AboutWidget( this ); mpGlobalConfigWidget->showClipboard(); QWidget *kmdTab = new QWidget( this ); QGridLayout *kmdLayout = new QGridLayout( kmdTab ); kmdLayout->addWidget( mpNumColumnsLabel, 0, 0 ); kmdLayout->addWidget( mpNumColumns, 0, 1 ); kmdLayout->addWidget( mpClearBeforeImport, 1, 0, 1, 2 ); kmdLayout->addWidget( mpExportAsRelative, 2, 0, 1, 2 ); kmdLayout->addWidget( mpRandomizeExport, 3, 0, 1, 2 ); kmdLayout->addWidget( mpUseCheckBoxes, 4, 0, 1, 2 ); kmdLayout->setRowStretch( 5, 1 ); kmdTab->setLayout( kmdLayout ); QPushButton *okButton = new QPushButton( tr("OK"), this ); QPushButton *cancelButton = new QPushButton( tr("Cancel"), this ); QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->addWidget( okButton ); buttonLayout->addWidget( cancelButton ); QBoxLayout *mainLayout = new QVBoxLayout( this ); QTabWidget *tabs = new QTabWidget( this ); tabs->addTab( kmdTab, tr("Karmadrome") ); tabs->addTab( mpGlobalConfigWidget, tr("Global") ); mainLayout->addWidget( about ); mainLayout->addWidget( tabs ); mainLayout->addLayout( buttonLayout ); setLayout( mainLayout ); connect( okButton, SIGNAL(clicked()), this, SLOT(accept()) ); connect( cancelButton, SIGNAL(clicked()), this, SLOT(reject()) ); connect( this, SIGNAL(accepted()), this, SLOT(writeSettings()) ); connect( this, SIGNAL(rejected()), this, SLOT(readSettings()) ); readSettings(); WidgetShot::addWidget( "Config", this ); }
SettingsWidget::SettingsWidget( MainModel *model, QWidget *parent) : QWidget( parent ), m_model( model ) { QBoxLayout *topLayout = new QVBoxLayout( this ); QBoxLayout *controlLayout = new QHBoxLayout; topLayout->addLayout( controlLayout ); m_syncingCheck = new QCheckBox( i18n("Syncing enabled") ); controlLayout->addWidget( m_syncingCheck ); connect( m_syncingCheck, SIGNAL( stateChanged( int ) ), SLOT( slotSyncingCheckChanged() ) ); QLabel *label = new QLabel; controlLayout->addWidget( label ); connect( m_model, SIGNAL( syncingStatusChanged( const QString & ) ), label, SLOT( setText( const QString & ) ) ); controlLayout->addStretch( 1 ); QPushButton *button = new QPushButton( i18n("Hide Settings") ); controlLayout->addWidget( button ); connect( button, SIGNAL( clicked() ), SLOT( hide() ) ); readConfig(); }
RedditBrowser::RedditBrowser(RedditStory story_, QVariantHash& history_) : QWidget(NULL), story(story_), showingComments(false), firstShow(true), history(history_), loading(false), frame(-1) { webview = new QWebView(this); url = new QLineEdit(this); toggle = new QPushButton("Show Comments", this); openInBrowser = new QPushButton("Open In Browser", this); QBoxLayout* topLayout = new QBoxLayout(QBoxLayout::LeftToRight); topLayout->addWidget(url); topLayout->addWidget(toggle); topLayout->addWidget(openInBrowser); QBoxLayout* mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); mainLayout->addLayout(topLayout); mainLayout->addWidget(webview); setLayout(mainLayout); connect(toggle, SIGNAL(clicked()), this, SLOT(switchView())); connect(openInBrowser, SIGNAL(clicked()), this, SLOT(openBrowser())); connect(webview, SIGNAL(loadFinished(bool)), this, SLOT(loadFinishedInt(bool))); connect(webview, SIGNAL(loadStarted()), this, SLOT(loadStartedInt())); connect(webview, SIGNAL(urlChanged(const QUrl&)), this, SLOT(urlChanged(const QUrl&))); webview->load(QUrl(story.link)); url->setText(story.link); }
FilterHeader::FilterHeader(QList<QTreeWidget *> &treewidgets, QWidget *parent) : QWidget( parent ), mItemNameNone( i18n("No Items")), mItemNameOne( i18n("1 Item") ), mItemNameMultiple( i18n("%1 of %2 Items") ) { QBoxLayout *topLayout = new QVBoxLayout; setLayout( topLayout ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHint() ); mTitleLabel = new QLabel(); topLayout->addWidget( mTitleLabel ); QBoxLayout *filterLayout = new QHBoxLayout; topLayout->addLayout( filterLayout ); QLabel *label = new QLabel( i18n("Search:")); filterLayout->addWidget( label ); mSearchLine = new CountingSearchLine( parent, treewidgets ); mSearchLine-> setClearButtonShown(true); connect( mSearchLine, SIGNAL( searchCountChanged() ), SLOT( setTitleLabel() ) ); filterLayout->addWidget( mSearchLine ); //setTabOrder( mSearchLine, listView ); setTitleLabel(); }
InfoPanel::InfoPanel(QWidget *parent) :QWidget(parent) { #ifdef K_DEBUG #ifdef Q_OS_WIN qDebug() << "[InfoPanel()]"; #else TINIT; #endif #endif QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom); QLabel *label = new QLabel(tr("Tips")); label->setAlignment(Qt::AlignHCenter); layout->addWidget(label); mainLayout->addLayout(layout); QTextEdit *textArea = new QTextEdit; textArea->setFixedHeight(250); textArea->setHtml("<p><b>" + tr("X Key or Right Mouse Button") + ":</b> " + tr("Close line") + "</p>"); mainLayout->addWidget(textArea); mainLayout->addStretch(2); }
QmitkBinaryThresholdULToolGUI::QmitkBinaryThresholdULToolGUI() :QmitkToolGUI() { // create the visible widgets QBoxLayout* mainLayout = new QVBoxLayout(this); QLabel* label = new QLabel( "Threshold :", this ); QFont f = label->font(); f.setBold(false); label->setFont( f ); mainLayout->addWidget(label); QBoxLayout* layout = new QHBoxLayout(); m_DoubleThresholdSlider = new ctkRangeWidget(); connect(m_DoubleThresholdSlider, SIGNAL(valuesChanged(double,double)), this, SLOT(OnThresholdsChanged(double,double))); layout->addWidget(m_DoubleThresholdSlider); mainLayout->addLayout(layout); m_DoubleThresholdSlider->setSingleStep(0.01); QPushButton* okButton = new QPushButton("Confirm Segmentation", this); connect( okButton, SIGNAL(clicked()), this, SLOT(OnAcceptThresholdPreview())); okButton->setFont( f ); mainLayout->addWidget( okButton ); connect( this, SIGNAL(NewToolAssociated(mitk::Tool*)), this, SLOT(OnNewToolAssociated(mitk::Tool*)) ); }
VideoAreaWidget::VideoAreaWidget(QWidget *parent) : QWidget(parent) { QBoxLayout *vLayout = new QVBoxLayout(this); vLayout->setMargin(0); vLayout->setSpacing(0); #ifdef APP_WIN QPalette p = palette(); p.setBrush(QPalette::Window, Qt::black); setPalette(p); setAutoFillBackground(true); #endif // hidden message widget messageLabel = new QLabel(this); messageLabel->setOpenExternalLinks(true); messageLabel->setMargin(7); messageLabel->setBackgroundRole(QPalette::ToolTipBase); messageLabel->setForegroundRole(QPalette::ToolTipText); messageLabel->setAutoFillBackground(true); messageLabel->setWordWrap(true); messageLabel->hide(); vLayout->addWidget(messageLabel); stackedLayout = new QStackedLayout(); vLayout->addLayout(stackedLayout); setLayout(vLayout); setAcceptDrops(true); setMouseTracking(true); }
VideoAreaWidget::VideoAreaWidget(QWidget *parent) : QWidget(parent), videoWidget(0) { QBoxLayout *vLayout = new QVBoxLayout(this); vLayout->setMargin(0); vLayout->setSpacing(0); // hidden message widget messageLabel = new QLabel(this); messageLabel->setOpenExternalLinks(true); messageLabel->setMargin(7); messageLabel->setBackgroundRole(QPalette::ToolTipBase); messageLabel->setForegroundRole(QPalette::ToolTipText); messageLabel->setAutoFillBackground(true); messageLabel->setWordWrap(true); messageLabel->hide(); vLayout->addWidget(messageLabel); stackedLayout = new QStackedLayout(); vLayout->addLayout(stackedLayout); #ifdef APP_SNAPSHOT snapshotPreview = new SnapshotPreview(); connect(stackedLayout, SIGNAL(currentChanged(int)), snapshotPreview, SLOT(hide())); #endif setAcceptDrops(true); setMouseTracking(true); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); }
void MiniProgrammerUI::setVertical(bool vertical) { if(m_isVertical == vertical) return; m_isVertical = vertical; QBoxLayout *from = ui->horLayout; QBoxLayout *to = ui->vertLayout; if(!vertical) std::swap(from, to); while(from->count() != 0) { QLayoutItem *i = from->takeAt(0); if(i->layout()) { i->layout()->setParent(0); to->addLayout(i->layout()); } else to->addItem(i); } delete to->takeAt(to->count()-1); to->addStretch(1); }
int drv_boxlayout(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9) { handle_head* head = (handle_head*)a0; QBoxLayout *self = (QBoxLayout*)head->native; switch (drvid) { case BOXLAYOUT_ADDLAYOUTWITH: { self->addLayout((QLayout*)drvGetNative(a1),drvGetInt(a2)); break; } case BOXLAYOUT_ADDWIDGETWITH: { self->addWidget((QWidget*)drvGetNative(a1),drvGetInt(a2),Qt::Alignment(drvGetInt(a3))); break; } case BOXLAYOUT_ADDSPACING: { self->addSpacing(drvGetInt(a1)); break; } case BOXLAYOUT_ADDSTRETCH: { self->addStretch(drvGetInt(a1)); break; } default: return 0; } return 1; }
PageWidgetItem::PageWidgetItem(QWidget *p, const QString &header, const QIcon &icon, QWidget *cfg) : QWidget(p) , wid(cfg) { static int size = -1; if (-1 == size) { size = QApplication::fontMetrics().height(); if (size > 20) { size = 32; } else { size = 22; } } QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); QBoxLayout *titleLayout = new QBoxLayout(QBoxLayout::LeftToRight, 0); titleLayout->addWidget(new QLabel("<b>" + header + "</b>", this)); titleLayout->addItem(new QSpacerItem(16, 16, QSizePolicy::Expanding, QSizePolicy::Minimum)); QLabel *icn = new QLabel(this); icn->setPixmap(icon.pixmap(size, size)); titleLayout->addWidget(icn); layout->addLayout(titleLayout); layout->addItem(new QSpacerItem(8, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); layout->addWidget(cfg); layout->setMargin(0); cfg->setParent(this); cfg->adjustSize(); adjustSize(); }
dmz::V8Value dmz::JsModuleUiV8QtBasic::_box_layout_add_layout (const v8::Arguments &Args) { v8::HandleScope scope; V8Value result = v8::Undefined (); JsModuleUiV8QtBasic *self = _to_self (Args); if (self) { QBoxLayout *layout = self->v8_to_qobject<QBoxLayout> (Args.This ()); if (layout) { if (Args.Length () > 0) { QLayout *newLayout = self->v8_to_qobject<QLayout> (Args[0]); if (newLayout) { layout->addLayout (newLayout); } } } } return scope.Close (result); }
void ResourceSelection::initGUI() { QBoxLayout *topLayout = new QVBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); QBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->setSpacing( KDialog::spacingHint() ); topLayout->addLayout( buttonLayout ); QLabel *abLabel = new QLabel( i18n( "Address Books" ), this ); buttonLayout->addWidget( abLabel ); buttonLayout->addStretch( 1 ); mAddButton = new QToolButton( this ); mAddButton->setIcon( KIcon( "list-add" ) ); mAddButton->setToolTip( i18n( "Add address book" ) ); buttonLayout->addWidget( mAddButton ); mEditButton = new QToolButton( this ); mEditButton->setIcon( KIcon( "document-properties" ) ); mEditButton->setEnabled( false ); mEditButton->setToolTip( i18n( "Edit address book settings" ) ); buttonLayout->addWidget( mEditButton ); mRemoveButton = new QToolButton( this ); mRemoveButton->setIcon( KIcon( "edit-delete" ) ); mRemoveButton->setEnabled( false ); mRemoveButton->setToolTip( i18n( "Remove address book" ) ); buttonLayout->addWidget( mRemoveButton ); mListView = new QTreeWidget( this ); mListView->setRootIsDecorated( false ); mListView->setHeaderLabel( i18n( "Address Books" ) ); mListView->header()->hide(); topLayout->addWidget( mListView ); }
QtCharacterPane::QtCharacterPane(QWidget* parent) : QWidget(parent) { QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom, this); avatarLabel_ = new QLabel(this); avatarLabel_->setMinimumSize(256, 256); layout->addWidget(avatarLabel_); nameLabel_ = new QLabel(this); //nameLabel_->setBold(); layout->addWidget(nameLabel_); QGridLayout* infoLayout = new QGridLayout(); layout->addLayout(infoLayout); QLabel* label = new QLabel("Corporation: ", this); corpLabel_ = new QLabel(this); infoLayout->addWidget(label, 0, 0); infoLayout->addWidget(corpLabel_, 0, 1); //allianceLabel_ = new QLabel(this); //infoLayout->addWidget(allianceLabel_, 1, 1); iskLabel_ = new QLabel(this); label = new QLabel("ISK: ", this); infoLayout->addWidget(label, 1, 0); infoLayout->addWidget(iskLabel_, 1, 1); int row = 2; std::vector<SkillAttribute::Attribute> allAttributes = SkillAttribute::allAttributes(); foreach (SkillAttribute::Attribute attribute, allAttributes) { label = new QLabel(P2QSTRING(SkillAttribute::toString(attribute)) + ": ", this); infoLayout->addWidget(label, row, 0); QLabel* valueLabel = new QLabel(this); infoLayout->addWidget(valueLabel, row, 1); ++row; attributeLabels_[attribute] = valueLabel; }
BoardPropertyWidget::BoardPropertyWidget(GameOption &option, QWidget *parent) : PropertyWidget(":/Pictures/board.png", parent), _option(option), _txtHeight(0), _txtWidth(0) { QIntValidator * intValidator = new QIntValidator(2,10000,this); QLabel * lblDimension = new QLabel("Dimension : ", this); _txtHeight = new QLineEdit("8", this); _txtHeight->setValidator(intValidator); QLabel * lblMultiplication = new QLabel("X", this); _txtWidth = new QLineEdit("8", this); _txtWidth->setValidator(intValidator); QHBoxLayout * lytDimension = new QHBoxLayout(); lytDimension->addStretch(); lytDimension->addWidget(lblDimension); lytDimension->addWidget(_txtHeight); lytDimension->addWidget(lblMultiplication); lytDimension->addWidget(_txtWidth); lytDimension->addStretch(); QBoxLayout * layout = (QBoxLayout *)this->layout(); layout->addLayout(lytDimension); QObject::connect(_txtHeight, SIGNAL(editingFinished()), this, SLOT(updateOption())); QObject::connect(_txtWidth, SIGNAL(editingFinished()), this, SLOT(updateOption())); }
Cleps_VidPlayer::Cleps_VidPlayer(QWidget *parent) : QWidget(parent) { videoWidget = new QVideoWidget(this); videoWidget->setContextMenuPolicy(Qt::CustomContextMenu); videoWidget->setAspectRatioMode(Qt::IgnoreAspectRatio); QBoxLayout *mreLayout = new QHBoxLayout; mreLayout->setMargin(0); mreLayout->setSpacing(0); QBoxLayout *layout = new QVBoxLayout; layout->addWidget(videoWidget); layout->addLayout(mreLayout); setLayout(layout); QShortcut *fll = new QShortcut(QKeySequence(Qt::Key_F11), videoWidget); fll->setContext(Qt::ApplicationShortcut); QShortcut *fllve = new QShortcut(QKeySequence(Qt::Key_Escape), videoWidget); fllve->setContext(Qt::ApplicationShortcut); connect(fll,SIGNAL(activated()),this,SLOT(fullScreen())); connect(fllve,SIGNAL(activated()),this,SLOT(exitFullScreen())); connect(videoWidget, SIGNAL(customContextMenuRequested(QPoint)),this, SLOT(context(QPoint))); }
MpdWidget::MpdWidget(QWidget *parent) : QWidget(parent) , aktPlay(false), aktStop(false) { timerMpd = new QTimer(); timerMpd->setInterval(100); connect(timerMpd, SIGNAL(timeout()), this, SLOT(psMpdHB())); timerMpd->start(); labelSender = new ScrollText(); labelVol = new ScrollText(); labelTitle = new ScrollText(); buttonPlay = new QPushButton("Play"); connect(buttonPlay, SIGNAL(clicked()), this, SLOT(slotPlay())); buttonStop = new QPushButton("Stop"); connect(buttonStop, SIGNAL(clicked()), this, SLOT(slotStop())); QBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addWidget(buttonPlay); buttonLayout->addWidget(buttonStop); QBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->addWidget(labelTitle); mainLayout->addWidget(labelSender); mainLayout->addWidget(labelVol); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); }
YesNoDialog::YesNoDialog(QWidget *parent, const QString &caption, const QString &text) : QDialog(parent) { setModal(true); setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(caption); QBoxLayout *vb = new QVBoxLayout(this); vb->setMargin(11); vb->setSpacing(6); QLabel *lblQuestion = new QLabel(text, this); vb->addWidget(lblQuestion); QHBoxLayout *hb = new QHBoxLayout(this); hb->setSpacing(6); QSpacerItem *spacer1 = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ); hb->addItem(spacer1); pbYes = new QPushButton(tr("&Yes"), this); hb->addWidget(pbYes); pbNo = new QPushButton(tr("&No"), this); hb->addWidget(pbNo); QSpacerItem *spacer2 = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ); hb->addItem(spacer2); vb->addLayout(hb); connect(pbYes, SIGNAL(clicked()), this, SLOT(actionYes())); connect(pbNo, SIGNAL(clicked()), this, SLOT(actionNo())); }