本文整理汇总了C++中QDialogButtonBox::setStandardButtons方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialogButtonBox::setStandardButtons方法的具体用法?C++ QDialogButtonBox::setStandardButtons怎么用?C++ QDialogButtonBox::setStandardButtons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialogButtonBox
的用法示例。
在下文中一共展示了QDialogButtonBox::setStandardButtons方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
CoreConnectDlg::CoreConnectDlg(QWidget *parent) : QDialog(parent)
{
_settingsPage = new CoreAccountSettingsPage(this);
_settingsPage->setStandAlone(true);
_settingsPage->load();
CoreAccountSettings s;
AccountId lastAccount = s.lastAccount();
if (lastAccount.isValid())
_settingsPage->setSelectedAccount(lastAccount);
setWindowTitle(tr("Connect to Core"));
setWindowIcon(QIcon::fromTheme("network-disconnect"));
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(_settingsPage);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
layout->addWidget(buttonBox);
connect(_settingsPage, SIGNAL(connectToCore(AccountId)), SLOT(accept()));
connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
}
示例2: QDialog
//---------------------------------------------------------------------------
// JudgeSelectDialog
//
//! Constructor.
//
//! @param parent the parent widget
//! @param f widget flags
//---------------------------------------------------------------------------
JudgeSelectDialog::JudgeSelectDialog(QWidget* parent, Qt::WFlags f)
: QDialog(parent, f)
{
QVBoxLayout* mainVlay = new QVBoxLayout(this);
mainVlay->setMargin(MARGIN);
mainVlay->setSpacing(SPACING);
QLabel* instructionLabel = new QLabel;
QString message = "You are now entering the full screen Word Judge mode.\n"
"To exit full screen mode, press ESC while holding the "
"Shift key.\n\n"
"Please choose a lexicon for the Word Judge.";
message = Auxil::dialogWordWrap(message);
instructionLabel->setText(message);
mainVlay->addWidget(instructionLabel);
lexiconWidget = new LexiconSelectWidget;
mainVlay->addWidget(lexiconWidget);
QDialogButtonBox* buttonBox = new QDialogButtonBox;
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
mainVlay->addWidget(buttonBox);
setWindowTitle(DIALOG_CAPTION);
}
示例3: editGraphClicked
void AnimCurveControl::editGraphClicked() {
#ifdef SEEXPR_USE_ANIMLIB
QDialog* dialog = new QDialog(this);
CETool* tool = new CETool;
animlib::AnimAttrID attr1("", "");
animlib::AnimCurve& anim = *new animlib::AnimCurve(attr1);
anim = _editable->curve;
QWidget* widg;
tool->map(widg, 0);
QVBoxLayout* layout = new QVBoxLayout();
dialog->resize(QSize(1024, 640));
dialog->setLayout(layout);
layout->addWidget(widg);
tool->addCurve(&anim);
QDialogButtonBox* buttonbar = new QDialogButtonBox();
buttonbar->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
connect(buttonbar, SIGNAL(accepted()), dialog, SLOT(accept()));
connect(buttonbar, SIGNAL(rejected()), dialog, SLOT(reject()));
layout->addWidget(buttonbar);
if (dialog->exec() == QDialog::Accepted) {
// copy points back from child
_editable->curve = anim;
_preview->sample(_editable->curve);
_preview->repaint();
emit controlChanged(_id);
}
#endif
}
示例4: initDialog
void KUrlRequesterDialogPrivate::initDialog(const QString &text, const QUrl &urlName)
{
QVBoxLayout *topLayout = new QVBoxLayout;
q->setLayout(topLayout);
QLabel *label = new QLabel(text, q);
topLayout->addWidget(label);
urlRequester = new KUrlRequester(urlName, q);
urlRequester->setMinimumWidth(urlRequester->sizeHint().width() * 3);
topLayout->addWidget(urlRequester);
urlRequester->setFocus();
QObject::connect(urlRequester->lineEdit(), SIGNAL(textChanged(QString)),
q, SLOT(_k_slotTextChanged(QString)));
/*
KFile::Mode mode = static_cast<KFile::Mode>( KFile::File |
KFile::ExistingOnly );
urlRequester_->setMode( mode );
*/
buttonBox = new QDialogButtonBox(q);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(buttonBox, SIGNAL(accepted()), q, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject()));
topLayout->addWidget(buttonBox);
_k_slotTextChanged(urlName.toString());
}
示例5: QDialog
RepoModel::UploadForm::UploadForm( const QString & file2upload,
QWidget * parent): QDialog(parent) {
author_le = new QLineEdit();
email_le = new QLineEdit();
save_ck = new QCheckBox("Save your personal information");
save_ck->setToolTip("The author and email will be saved and will be written to you next time");
comment_te = new QTextEdit();
// setup the layout
QGroupBox * personalGroupBox = new QGroupBox("Personal Group Box");
QFormLayout * personalLayout = new QFormLayout();
personalLayout->addRow("Author",author_le);
personalLayout->addRow("Email",email_le);
QVBoxLayout * gpBox = new QVBoxLayout();
gpBox->addWidget(save_ck);
gpBox->addLayout(personalLayout);
personalGroupBox->setLayout(gpBox);
QLabel * cmLabel = new QLabel("Comment");
QDialogButtonBox * buttonBox = new QDialogButtonBox();
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(personalGroupBox);
layout->addWidget(cmLabel);
layout->addWidget(comment_te);
layout->addWidget(buttonBox);
setLayout(layout);
setWindowTitle(QString("Upload - %2").arg(file2upload));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
示例6: ADM_strdup
/**
\fn getProfileName
\brief Popup a dialog that asks the user the preset name
*/
static char *getProfileName(void)
{
QDialog dialog;
dialog.setWindowTitle(QString::fromUtf8("Save Profile"));
QDialogButtonBox *buttonBox = new QDialogButtonBox();
QVBoxLayout *vboxLayout = new QVBoxLayout();
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
QLineEdit *text=new QLineEdit;
// text->setAcceptRichText(false);
text->setText("my profile");
text->selectAll();
vboxLayout->addWidget(text);
vboxLayout->addWidget(buttonBox);
dialog.setLayout(vboxLayout);
if(dialog.exec()!=QDialog::Accepted)
{
ADM_info("Canceled");
return NULL;
}
QString fileName=text->text();
const char *out=fileName.toUtf8().constData();
return ADM_strdup(out);
}
示例7: QDialog
AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
: QDialog(parent),
d(new AttachToQmlPortDialogPrivate)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Debugger"));
d->kitChooser = new DebuggerKitChooser(DebuggerKitChooser::RemoteDebugging, this);
d->kitChooser->populate();
d->portSpinBox = new QSpinBox(this);
d->portSpinBox->setMaximum(65535);
d->portSpinBox->setValue(3768);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
QFormLayout *formLayout = new QFormLayout();
formLayout->addRow(tr("Kit:"), d->kitChooser);
formLayout->addRow(tr("&Port:"), d->portSpinBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
}
示例8: QDialog
ConfigDialog::ConfigDialog(QWidget *parent)
: QDialog(parent),
d(new ConfigDialogPrivate(this))
{
setObjectName(QStringLiteral("SonnetConfigDialog"));
setModal(true);
setWindowTitle(tr("Spell Checking Configuration"));
QVBoxLayout *layout = new QVBoxLayout;
setLayout(layout);
d->ui = new ConfigWidget(this);
layout->addWidget(d->ui);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Ok
| QDialogButtonBox::Cancel);
layout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(accepted()),
this, SLOT(slotOk()));
connect(buttonBox, SIGNAL(rejected()),
this, SLOT(reject()));
/*
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()),
this, SLOT(slotApply()));
*/
connect(d->ui, SIGNAL(configChanged()),
this, SLOT(slotConfigChanged()));
connect(d->ui, SIGNAL(configChanged()),
this, SIGNAL(configChanged()));
}
示例9: QWidget
LicenseViewer::LicenseViewer(QWidget* parent)
: QWidget()
{
setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(tr("License Viewer"));
m_textBrowser = new QTextBrowser(this);
QFont serifFont = m_textBrowser->font();
serifFont.setFamily("Courier");
m_textBrowser->setFont(serifFont);
QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Close);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
QVBoxLayout* l = new QVBoxLayout(this);
l->addWidget(m_textBrowser);
l->addWidget(buttonBox);
setLayout(l);
resize(600, 500);
QzTools::centerWidgetToParent(this, parent);
}
示例10: addrB
AddressDialog::AddressDialog( QWidget *p ) :
QDialog( p ), addrB( Qt::Vertical )
{
setWindowTitle( tr( "Dodaj adres" ) );
QDialogButtonBox *buttonBox = new QDialogButtonBox;
buttonBox->setStandardButtons( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
QComboBox &pB = addrB.getComboBox();
int idx = pB.findText( QMPlay2Core.getSettings().getString( "AddressDialog/Choice" ) );
if ( idx > -1 )
pB.setCurrentIndex( idx );
addAndPlayB.setText( tr( "Odtwarzaj" ) );
addAndPlayB.setChecked( QMPlay2Core.getSettings().getBool( "AddressDialog/AddAndPlay", true ) );
QGridLayout *layout = new QGridLayout( this );
layout->addWidget( &addrB, 0, 0, 1, 2 );
layout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ), 1, 0, 1, 2 ); //vSpacer
layout->addWidget( &addAndPlayB, 2, 0, 1, 1 );
layout->addWidget( buttonBox, 2, 1, 1, 1 );
layout->setMargin( 3 );
addrB.setFocus();
resize( 625, 0 );
}
示例11: QDialog
SettingsDialog::SettingsDialog(QWidget *parent)
: QDialog(parent)
, reverseYAxisCheckBox(new QCheckBox(tr("Reverse Y-Axis"), this))
{
QVBoxLayout *dialogLayout = new QVBoxLayout(this);
// Populate checkboxes
reverseYAxisCheckBox->setChecked(false);
// Add widgets to layout
dialogLayout->addWidget(reverseYAxisCheckBox);
// Add standard buttons to layout
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
dialogLayout->addWidget(buttonBox);
// Connect standard buttons
connect((QObject*)buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
this, SLOT(accept()));
connect((QObject*)buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
this, SLOT(reject()));
setLayout(dialogLayout);
}
示例12: NPPDialog
MouseCommandList::MouseCommandList(void): NPPDialog()
{
central = new QWidget;
QPointer<QVBoxLayout> main_layout = new QVBoxLayout;
central->setLayout(main_layout);
main_layout->setSpacing(10);
this->setClient(central); // IMPORTANT: it must be called AFTER setting the layout
QPointer<QLabel> mouse_prompt = new QLabel(QString("<h2>Mouse Commands</h2>"));
main_layout->addWidget(mouse_prompt, Qt::AlignCenter);
QPointer<QVBoxLayout> vlay_mouse_commands = new QVBoxLayout;
add_mouse_commands(vlay_mouse_commands);
main_layout->addLayout(vlay_mouse_commands);
QDialogButtonBox buttons;
buttons.setStandardButtons(QDialogButtonBox::Ok);
connect(&buttons, SIGNAL(accepted()), this, SLOT(close()));
main_layout->addWidget(&buttons);
main_layout->addStretch(1);
setWindowTitle(tr("Mouse Command List"));
this->clientSizeUpdated();
this->exec();
}
示例13: QDialog
ListWidgetEditor::ListWidgetEditor(QDesignerFormWindowInterface *form,
QWidget *parent)
: QDialog(parent)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QDialogButtonBox *buttonBox = new QDialogButtonBox;
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));
m_itemsEditor = new ItemListEditor(form, 0);
m_itemsEditor->layout()->setMargin(0);
m_itemsEditor->setNewItemText(tr("New Item"));
QFrame *sep = new QFrame;
sep->setFrameStyle(QFrame::HLine | QFrame::Sunken);
QBoxLayout *box = new QVBoxLayout(this);
box->addWidget(m_itemsEditor);
box->addWidget(sep);
box->addWidget(buttonBox);
// Numbers copied from itemlisteditor.ui
// (Automatic resizing doesn't work because ui has parent).
resize(550, 360);
}
示例14: QDialog
QmlProfilerAttachDialog::QmlProfilerAttachDialog(QWidget *parent) :
QDialog(parent),
d(new QmlProfilerAttachDialogPrivate)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start QML Profiler"));
d->kitChooser = new KitChooser(this);
d->kitChooser->populate();
d->portSpinBox = new QSpinBox(this);
d->portSpinBox->setMaximum(65535);
d->portSpinBox->setValue(3768);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
QFormLayout *formLayout = new QFormLayout();
formLayout->addRow(tr("Kit:"), d->kitChooser);
formLayout->addRow(tr("&Port:"), d->portSpinBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
verticalLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
示例15: QDialog
QDialog * MainWindow::createAddSessionDialogue(const QString & title, MTListWidget * lw)
{
QDialog * d = new QDialog(this);
#ifdef Q_WS_MAC
d->setWindowTitle(QString("%1 - %2").arg(current_db_name).arg(title));
#else
d->setWindowTitle(QString("%1 - %2 - iTest").arg(current_db_name).arg(title));
#endif
d->setMinimumSize(QSize(300, 100));
QVBoxLayout * vl = new QVBoxLayout(d);
vl->setMargin(6); vl->setSpacing(6);
QHBoxLayout * hl = new QHBoxLayout(d);
hl->setMargin(0); hl->setSpacing(6);
QLabel * lbl = new QLabel(tr("Search:"), d);
ExtendedLineEdit * sle = new ExtendedLineEdit(d);
hl->addWidget(lbl);
hl->addWidget(sle);
vl->addLayout(hl);
if (lw == NULL) { lw = new MTListWidget(d); } else { lw->setParent(d); }
QObject::connect(lw, SIGNAL(itemDoubleClicked(QListWidgetItem *)), d, SLOT(accept()));
QObject::connect(sle, SIGNAL(textChanged(QLineEdit *, const QString &)), lw, SLOT(filterItems(QLineEdit *, const QString &)));
vl->addWidget(lw);
QDialogButtonBox * bb = new QDialogButtonBox(d);
bb->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(bb, SIGNAL(accepted()), d, SLOT(accept()));
QObject::connect(bb, SIGNAL(rejected()), d, SLOT(reject()));
vl->addWidget(bb);
return d;
}