当前位置: 首页>>代码示例>>C++>>正文


C++ QDialogButtonBox::setOrientation方法代码示例

本文整理汇总了C++中QDialogButtonBox::setOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialogButtonBox::setOrientation方法的具体用法?C++ QDialogButtonBox::setOrientation怎么用?C++ QDialogButtonBox::setOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDialogButtonBox的用法示例。


在下文中一共展示了QDialogButtonBox::setOrientation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QDialogButtonBox

InputDialog::InputDialog(QWidget* parent,
                         const QString& title,
                         InputType type,
                         const QString& firstLabelText,
                         const QString& secondLabelText)
    : QDialog(parent) {
  setWindowTitle(title);
  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);  // Remove help
                                                                     // button (?)

  QGridLayout* glayout = new QGridLayout;
  QDialogButtonBox* buttonBox =
      new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
  buttonBox->setOrientation(Qt::Horizontal);
  VERIFY(connect(buttonBox, &QDialogButtonBox::accepted, this, &InputDialog::accept));
  VERIFY(connect(buttonBox, &QDialogButtonBox::rejected, this, &InputDialog::reject));
  QLabel* firstLabel = new QLabel(firstLabelText);
  firstLine_ = new QLineEdit;
  secondLine_ = new QLineEdit;

  glayout->addWidget(firstLabel, 0, 0);
  glayout->addWidget(firstLine_, 0, 1);

  if (type == DoubleLine) {
    QLabel* secondLabel = new QLabel(secondLabelText);
    glayout->addWidget(secondLabel, 1, 0);
    glayout->addWidget(secondLine_, 1, 1);
  }

  glayout->addWidget(buttonBox, 2, 1);
  glayout->setSizeConstraint(QLayout::SetFixedSize);
  setLayout(glayout);
}
开发者ID:fastogt,项目名称:fastonosql,代码行数:33,代码来源:input_dialog.cpp

示例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);
}
开发者ID:martindemello,项目名称:Zyzzyva,代码行数:37,代码来源:JudgeSelectDialog.cpp

示例3: QDialog

    CreateUserDialog::CreateUserDialog(const QString &serverName,
        const QString &database, const MongoUser &user,
        QWidget *parent) : QDialog(parent),
        _user(user)
    {
        VERIFY(user.version() < MongoUser::minimumSupportedVersion);
        setWindowTitle("Add User");
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)
        setMinimumWidth(400);

        Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), serverName);
        Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), database);

        QFrame *hline = new QFrame();
        hline->setFrameShape(QFrame::HLine);
        hline->setFrameShadow(QFrame::Sunken);

        _userNameLabel= new QLabel("Name:");
        _userNameEdit = new QLineEdit();
        _userNameEdit->setText(QtUtils::toQString(user.name()));
        _userPassLabel= new QLabel("Password:");
        _userPassEdit = new QLineEdit();
        _userPassEdit->setEchoMode(QLineEdit::Password);
        _readOnlyCheckBox = new QCheckBox("Read Only");
        _readOnlyCheckBox->setChecked(user.readOnly());

        QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));

        QHBoxLayout *hlayout = new QHBoxLayout();
        hlayout->addStretch(1);
        hlayout->addWidget(buttonBox);

        QHBoxLayout *vlayout = new QHBoxLayout();
        vlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
        vlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft);
        vlayout->addStretch(1);

        QGridLayout *namelayout = new QGridLayout();
        namelayout->setContentsMargins(0, 7, 0, 7);
        namelayout->addWidget(_userNameLabel, 0, 0);
        namelayout->addWidget(_userNameEdit, 0, 1);
        namelayout->addWidget(_userPassLabel, 1, 0);
        namelayout->addWidget(_userPassEdit, 1, 1);
        namelayout->addWidget(_readOnlyCheckBox, 2, 1);

        QVBoxLayout *layout = new QVBoxLayout();
        layout->addLayout(vlayout);
        layout->addWidget(hline);
        layout->addLayout(namelayout);
        layout->addLayout(hlayout);
        setLayout(layout);

        _userNameEdit->setFocus();
    }
开发者ID:melinite,项目名称:robomongo,代码行数:58,代码来源:CreateUserDialog.cpp

示例4: setupUI

void BasicSettingsDlg::setupUI(QDialog *dlg, enum PerformanceLevel lvl) {
  // Erase old layout/info.
  qDeleteAll(dlg->children());

  dlg->setWindowTitle("ImageVis3D Settings");
  dlg->setObjectName(QString::fromUtf8("BasicSettingsDlg"));
  dlg->setWindowModality(Qt::ApplicationModal);
  dlg->resize(300, 150);
  dlg->setContextMenuPolicy(Qt::DefaultContextMenu);
  dlg->setSizeGripEnabled(true);
  dlg->setModal(true);

  QVBoxLayout* vlayout = new QVBoxLayout(this);
  vlayout->setObjectName(QString::fromUtf8("vlayout"));

  // perf / slider / and a description of the current setting
  QHBoxLayout* hPerf = new QHBoxLayout();
  QLabel* lPerf = new QLabel("Performance:");
  this->slPerf = new QSlider();
  this->slPerf->setOrientation(Qt::Horizontal);
  this->slPerf->setMinimum(MAX_RESPONSIVENESS);
  this->slPerf->setMaximum(MAX_PERFORMANCE);
  this->slPerf->setMinimumSize(QSize(75, 20));
  this->slPerf->setTickPosition(QSlider::TicksBelow);
  this->slPerf->setTickInterval(1);
  this->slPerf->setValue(int(lvl));
  this->lDesc = new QLabel("Favor more responsive behavior.");
  QSizePolicy lblPol(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
  lblPol.setHorizontalStretch(1);
  lblPol.setVerticalStretch(1);
  this->lDesc->setSizePolicy(lblPol);
  this->lDesc->setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
  this->lDesc->setWordWrap(true);
  hPerf->addWidget(lPerf);
  hPerf->addWidget(this->slPerf);
  hPerf->addWidget(this->lDesc);

  // buttons: we put them in a layout so we can add an 'advanced' one.
  QHBoxLayout* hbuttons = new QHBoxLayout();
  QDialogButtonBox* bbox = new QDialogButtonBox();
  QPushButton* btnAdvanced = new QPushButton("Advanced");
  bbox->setOrientation(Qt::Horizontal);
  bbox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
  hbuttons->addWidget(btnAdvanced);
  hbuttons->addWidget(bbox);

  vlayout->addLayout(hPerf);
  vlayout->addLayout(hbuttons);
  this->setLayout(vlayout);

  connect(slPerf, SIGNAL(valueChanged(int)), dlg, SLOT(PerfLevelChanged(int)));
  connect(bbox, SIGNAL(accepted()), dlg, SLOT(accept()));
  connect(bbox, SIGNAL(rejected()), dlg, SLOT(reject()));
  connect(btnAdvanced, SIGNAL(clicked()), dlg, SLOT(AdvancedFeatures()));
  this->PerfLevelChanged(int(lvl));
}
开发者ID:Daylang,项目名称:ImageVis3D,代码行数:56,代码来源:BasicSettingsDlg.cpp

示例5: QDialog

    DocumentTextEditor::DocumentTextEditor(const QString &server, const QString &database, const QString &collection,
                                           const QString &json, bool readonly /* = false */, QWidget *parent) :
        QDialog(parent),
        _readonly(readonly)
    {
        setMinimumWidth(700);
        setMinimumHeight(550);

        Indicator *collectionIndicator = new Indicator(GuiRegistry::instance().collectionIcon(), collection);
        Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), database);
        Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), server);

        QPushButton *validate = new QPushButton("Validate");
        validate->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation));
        VERIFY(connect(validate, SIGNAL(clicked()), this, SLOT(onValidateButtonClicked())));

        _queryText = new FindFrame(this);
        _configureQueryText();
        _queryText->sciScintilla()->setText(json);
        VERIFY(connect(_queryText->sciScintilla(), SIGNAL(textChanged()), this, SLOT(onQueryTextChanged())));

        QHBoxLayout *hlayout = new QHBoxLayout();
        hlayout->setContentsMargins(2, 0, 5, 1);
        hlayout->setSpacing(0);
        hlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
        hlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft);
        hlayout->addWidget(collectionIndicator, 0, Qt::AlignLeft);
        hlayout->addStretch(1);

        QDialogButtonBox *buttonBox = new QDialogButtonBox (this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));

        QHBoxLayout *bottomlayout = new QHBoxLayout();
        bottomlayout->addWidget(validate);
        bottomlayout->addStretch(1);
        bottomlayout->addWidget(buttonBox);

        QVBoxLayout *layout = new QVBoxLayout();

        // show top bar only if we have info for it
        if (!(server.isEmpty() && database.isEmpty() && collection.isEmpty()))
            layout->addLayout(hlayout);

        layout->addWidget(_queryText);
        layout->addLayout(bottomlayout);
        setLayout(layout);

        if (_readonly)
            buttonBox->button(QDialogButtonBox::Save)->hide();
    }
开发者ID:kewinwang,项目名称:robomongo,代码行数:53,代码来源:DocumentTextEditor.cpp

示例6: QDialog

    DiscoveryDiagnosticDialog::DiscoveryDiagnosticDialog(QWidget* parent, IConnectionSettingsBaseSPtr connection, IClusterSettingsBaseSPtr cluster)
        : QDialog(parent), cluster_(cluster)
    {
        using namespace translations;

        setWindowTitle(trConnectionDiscovery);
        setWindowIcon(GuiFactory::instance().serverIcon());
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)

        QVBoxLayout* mainLayout = new QVBoxLayout;

        executeTimeLabel_ = new QLabel;
        executeTimeLabel_->setText(connectionStatusTemplate.arg("execute..."));
        mainLayout->addWidget(executeTimeLabel_);

        statusLabel_ = new QLabel(timeTemplate.arg("calculate..."));
        iconLabel_ = new QLabel;
        QIcon icon = GuiFactory::instance().failIcon();
        const QPixmap pm = icon.pixmap(stateIconSize);
        iconLabel_->setPixmap(pm);

        mainLayout->addWidget(statusLabel_);
        mainLayout->addWidget(iconLabel_, 1, Qt::AlignCenter);

        listWidget_ = new QTreeWidget;
        listWidget_->setIndentation(5);

        QStringList colums;
        colums << trName << trAddress << trType;
        listWidget_->setHeaderLabels(colums);
        listWidget_->setContextMenuPolicy(Qt::ActionsContextMenu);
        listWidget_->setIndentation(15);
        listWidget_->setSelectionMode(QAbstractItemView::MultiSelection); // single item can be draged or droped
        listWidget_->setSelectionBehavior(QAbstractItemView::SelectRows);

        mainLayout->addWidget(listWidget_);
        listWidget_->setEnabled(false);
        listWidget_->setToolTip(tr("Select items which you want add to cluster."));

        QDialogButtonBox* buttonBox = new QDialogButtonBox;
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Ok);
        VERIFY(connect(buttonBox, &QDialogButtonBox::accepted, this, &DiscoveryDiagnosticDialog::accept));

        mainLayout->addWidget(buttonBox);
        setFixedSize(QSize(fix_width, fix_height));
        setLayout(mainLayout);

        glassWidget_ = new fasto::qt::gui::GlassWidget(GuiFactory::instance().pathToLoadingGif(), trTryToConnect, 0.5, QColor(111, 111, 100), this);
        testConnection(connection);
    }
开发者ID:qtx0213,项目名称:fastonosql,代码行数:51,代码来源:discovery_dialog.cpp

示例7: QDialog

PasswordDialog::PasswordDialog(const QString& description, QWidget* parent)
    : QDialog(parent),
      description_(nullptr),
      login_label_(nullptr),
      login_text_(nullptr),
      password_label_(nullptr),
      password_box_(nullptr),
      password_echo_mode_button_(nullptr) {
  Qt::WindowFlags flags = windowFlags();
  setWindowFlags(flags & ~Qt::WindowContextHelpButtonHint);

  QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
  buttonBox->setOrientation(Qt::Horizontal);
  VERIFY(connect(buttonBox, &QDialogButtonBox::accepted, this, &PasswordDialog::accept));
  VERIFY(connect(buttonBox, &QDialogButtonBox::rejected, this, &PasswordDialog::reject));

  description_ = new QLabel;
  description_->setText(description);
  description_->setOpenExternalLinks(true);

  QHBoxLayout* profile_layout = new QHBoxLayout;
  login_label_ = new QLabel;
  login_text_ = new QLineEdit;
  profile_layout->addWidget(login_label_);
  profile_layout->addWidget(login_text_);

  QHBoxLayout* password_layout = new QHBoxLayout;
  password_label_ = new QLabel;
  password_box_ = new QLineEdit;
  password_box_->setEchoMode(QLineEdit::Password);
  password_echo_mode_button_ = new QPushButton;
  VERIFY(connect(password_echo_mode_button_, &QPushButton::clicked, this, &PasswordDialog::togglePasswordEchoMode));
  password_layout->addWidget(password_label_);
  password_layout->addWidget(password_box_);
  password_layout->addWidget(password_echo_mode_button_);

  QVBoxLayout* mainLayout = new QVBoxLayout;
  mainLayout->addWidget(description_);
  mainLayout->addLayout(profile_layout);
  mainLayout->addLayout(password_layout);
  mainLayout->addWidget(buttonBox);
  mainLayout->setSizeConstraint(QLayout::SetFixedSize);
  setLayout(mainLayout);
  retranslateUi();
}
开发者ID:mdvx,项目名称:fastonosql,代码行数:45,代码来源:password_dialog.cpp

示例8: QDialogButtonBox

ChangePasswordServerDialog::ChangePasswordServerDialog(const QString& title,
                                                       core::IServerSPtr server,
                                                       QWidget* parent)
    : QDialog(parent), server_(server) {
  CHECK(server_);

  setWindowTitle(title);
  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

  QVBoxLayout* mainLayout = new QVBoxLayout;
  QHBoxLayout* passLayout = new QHBoxLayout;
  passLayout->addWidget(new QLabel(trPassword));
  passwordLineEdit_ = new QLineEdit;
  passwordLineEdit_->setEchoMode(QLineEdit::Password);
  passLayout->addWidget(passwordLineEdit_);
  mainLayout->addLayout(passLayout);

  QHBoxLayout* cpassLayout = new QHBoxLayout;
  cpassLayout->addWidget(new QLabel(trCPassword));
  confPasswordLineEdit_ = new QLineEdit;
  confPasswordLineEdit_->setEchoMode(QLineEdit::Password);
  cpassLayout->addWidget(confPasswordLineEdit_);
  mainLayout->addLayout(cpassLayout);

  QDialogButtonBox* buttonBox =
      new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
  buttonBox->setOrientation(Qt::Horizontal);
  VERIFY(connect(buttonBox, &QDialogButtonBox::accepted, this,
                 &ChangePasswordServerDialog::tryToCreatePassword));
  VERIFY(
      connect(buttonBox, &QDialogButtonBox::rejected, this, &ChangePasswordServerDialog::reject));

  VERIFY(connect(server_.get(), &core::IServer::ChangePasswordStarted, this,
                 &ChangePasswordServerDialog::startChangePassword));
  VERIFY(connect(server_.get(), &core::IServer::ChangePasswordFinished, this,
                 &ChangePasswordServerDialog::finishChangePassword));

  mainLayout->addWidget(buttonBox);
  setMinimumSize(QSize(min_width, min_height));
  setLayout(mainLayout);

  glassWidget_ = new common::qt::gui::GlassWidget(GuiFactory::instance().pathToLoadingGif(),
                                                  translations::trTryToChangePassword, 0.5,
                                                  QColor(111, 111, 100), this);
}
开发者ID:fastogt,项目名称:fastonosql,代码行数:45,代码来源:change_password_server_dialog.cpp

示例9: QDialog

DialogResourceText::DialogResourceText(QString text, QWidget *parent): QDialog(parent)
{
	setWindowTitle(tr("Resource Dialog"));
	
	QDialogButtonBox *dialogbuttonbox = new QDialogButtonBox(this);
	dialogbuttonbox->setOrientation(Qt::Horizontal);
	dialogbuttonbox->setStandardButtons(QDialogButtonBox::Ok);

	QTextEdit *textedit = new QTextEdit(this);
	textedit->setAcceptRichText(true);
	textedit->setText(text);

	QGridLayout *layout = new QGridLayout(this);
	layout->addWidget(textedit);
	layout->addWidget(dialogbuttonbox);

	connect(dialogbuttonbox, SIGNAL(accepted()), this, SLOT(accept()));
}
开发者ID:einfallstoll,项目名称:testapplication-qt5,代码行数:18,代码来源:DialogResourceText.cpp

示例10: QDialog

    /**
     * @brief Constructs dialog with specified connection
     */
    ConnectionDialog::ConnectionDialog(ConnectionSettings *connection) 
        : QDialog(),
        _connection(connection)
    {
        setWindowTitle("Connection Settings");
        setWindowIcon(GuiRegistry::instance().serverIcon());
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)

        QPushButton *testButton = new QPushButton("&Test");
        testButton->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation));
        VERIFY(connect(testButton, SIGNAL(clicked()), this, SLOT(testConnection())));

        QHBoxLayout *bottomLayout = new QHBoxLayout;
        bottomLayout->addWidget(testButton, 1, Qt::AlignLeft);
        QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));
        bottomLayout->addWidget(buttonBox);

        QTabWidget *tabWidget = new QTabWidget;
                
        _basicTab    = new ConnectionBasicTab(_connection);
        _authTab     = new ConnectionAuthTab(_connection);
        _advancedTab = new ConnectionAdvancedTab(_connection);
#ifdef SSH_SUPPORT_ENABLED
        _sshTab = new SshTunelTab(_connection);
#endif

        tabWidget->addTab(_basicTab,    "Connection");
        tabWidget->addTab(_authTab,     "Authentication");
        tabWidget->addTab(_advancedTab, "Advanced");
#ifdef SSH_SUPPORT_ENABLED
        tabWidget->addTab(_sshTab, "SSH Tunnel");
#endif

        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->addWidget(tabWidget);
        mainLayout->addLayout(bottomLayout);
        setLayout(mainLayout);

        _basicTab->setFocus();
    }
开发者ID:elmariofredo,项目名称:robomongo,代码行数:47,代码来源:ConnectionDialog.cpp

示例11: QDialog

CInputDialog::CInputDialog
(const QString& caption, const QString& description, const QString& text, QWidget *parent, Qt::WindowFlags wflags )
        : QDialog(parent, wflags) {
    QVBoxLayout *vboxLayout;
    QLabel *label;
    QHBoxLayout *hboxLayout;
    QPushButton *clearButton;
    QSpacerItem *spacerItem;
    QDialogButtonBox *buttonBox;

    setWindowTitle(caption);

    resize(400, 300);
    vboxLayout = new QVBoxLayout(this);
    label = new QLabel(description, this);
    vboxLayout->addWidget(label);

    m_textEdit = new QTextEdit(this);
    vboxLayout->addWidget(m_textEdit);
    m_textEdit->setWordWrapMode( QTextOption::WordWrap );
    m_textEdit->setText(text);
    if (!text.isEmpty())
        m_textEdit->selectAll();

    hboxLayout = new QHBoxLayout();
    clearButton = new QPushButton(this);
    clearButton->setText(tr("Clear"));
    hboxLayout->addWidget(clearButton);
    spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
    hboxLayout->addItem(spacerItem);
    buttonBox = new QDialogButtonBox(this);
    buttonBox->setOrientation(Qt::Horizontal);
    buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::NoButton | QDialogButtonBox::Ok);
    util::prepareDialogBox(buttonBox);
    hboxLayout->addWidget(buttonBox);

    vboxLayout->addLayout(hboxLayout);

    QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    QObject::connect(clearButton, SIGNAL(clicked()), m_textEdit, SLOT(clear()));

    m_textEdit->setFocus();
}
开发者ID:bibletime,项目名称:historic-bibletime-svn,代码行数:44,代码来源:cinputdialog.cpp

示例12: QDialogButtonBox

	NewSoundDialog::NewSoundDialog(QWidget *parent, const SoundController *soundController) :
		QDialog(parent),
		soundController(soundController),
		sceneSound(nullptr)
	{
		this->setWindowTitle("New Sound");
		this->resize(530, 160);

		setupNameFields();
		setupSoundFilenameFields();
		setupSoundTypeFields();

		QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
		buttonBox->setGeometry(QRect(30, 120, 475, 22));
		buttonBox->setOrientation(Qt::Horizontal);
		buttonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);

		QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
		QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
	}
开发者ID:ServerGame,项目名称:UrchinEngine,代码行数:20,代码来源:NewSoundDialog.cpp

示例13: QDialog

ConnectionDiagnosticDialog::ConnectionDiagnosticDialog(QWidget* parent,
                                                       core::IConnectionSettingsBaseSPtr connection)
    : QDialog(parent) {
  setWindowTitle(translations::trConnectionDiagnostic);
  setWindowIcon(GuiFactory::instance().icon(connection->Type()));
  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);  // Remove help
                                                                     // button (?)

  QVBoxLayout* mainLayout = new QVBoxLayout;

  executeTimeLabel_ = new QLabel;
  executeTimeLabel_->setText(translations::trConnectionStatusTemplate_1S.arg("execute..."));
  mainLayout->addWidget(executeTimeLabel_);

  statusLabel_ = new QLabel(translations::trTimeTemplate_1S.arg("calculate..."));
  statusLabel_->setWordWrap(true);
  iconLabel_ = new QLabel;
  QIcon icon = GuiFactory::instance().failIcon();
  const QPixmap pm = icon.pixmap(stateIconSize);
  iconLabel_->setPixmap(pm);

  mainLayout->addWidget(statusLabel_);
  mainLayout->addWidget(iconLabel_, 1, Qt::AlignCenter);

  QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
  buttonBox->setOrientation(Qt::Horizontal);
  VERIFY(
      connect(buttonBox, &QDialogButtonBox::accepted, this, &ConnectionDiagnosticDialog::accept));

  mainLayout->addWidget(buttonBox);
  mainLayout->setSizeConstraint(QLayout::SetFixedSize);
  setLayout(mainLayout);

  glassWidget_ = new common::qt::gui::GlassWidget(GuiFactory::instance().pathToLoadingGif(),
                                                  translations::trTryToConnect, 0.5,
                                                  QColor(111, 111, 100), this);
  startTestConnection(connection);
}
开发者ID:fastogt,项目名称:fastonosql,代码行数:38,代码来源:connection_diagnostic_dialog.cpp

示例14: createWidgets

void QDialogBeheerLayouts::createWidgets()
{
	//
	// Beheer Layouts
	//

	QGroupBox *boxKies = new QGroupBox("Beheer Layouts");
	QVBoxLayout *hboxKies = new QVBoxLayout(boxKies);

	// Lijst layouts
	m_pListLayout = new QListWidget();

	// Buttons
	m_pBtnVerwijder = new QPushButton("Verwijder");
	m_pBtnWijzig = new QPushButton("Wijzig");
	QHBoxLayout *vboxBtn = new QHBoxLayout();
	vboxBtn->addWidget(m_pBtnVerwijder);
	vboxBtn->addWidget(m_pBtnWijzig);

	hboxKies->addWidget(m_pListLayout);
	hboxKies->addLayout(vboxBtn);

	//
	// ButtonBox
	//

	QDialogButtonBox *buttonBox = new QDialogButtonBox();
	buttonBox->setOrientation(Qt::Horizontal);
	buttonBox->setStandardButtons(QDialogButtonBox::Ok);
	QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));

	QVBoxLayout *mainLayout = new QVBoxLayout();
	mainLayout->addWidget(boxKies);
	mainLayout->addWidget(buttonBox);

	setLayout(mainLayout);
}
开发者ID:AmesianX,项目名称:Publisher,代码行数:37,代码来源:QDialogBeheerLayouts.cpp

示例15: QDialog

    ConnectionDiagnosticDialog::ConnectionDiagnosticDialog(QWidget* parent, IConnectionSettingsBaseSPtr connection)
        : QDialog(parent)
    {
        using namespace translations;

        setWindowTitle(trConnectionDiagnostic);
        setWindowIcon(GuiFactory::instance().icon(connection->connectionType()));
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)

        QVBoxLayout* mainLayout = new QVBoxLayout;

        executeTimeLabel_ = new QLabel;
        executeTimeLabel_->setText(connectionStatusTemplate.arg("execute..."));
        mainLayout->addWidget(executeTimeLabel_);

        statusLabel_ = new QLabel(timeTemplate.arg("calculate..."));
        iconLabel_ = new QLabel;
        QIcon icon = GuiFactory::instance().failIcon();
        const QPixmap pm = icon.pixmap(stateIconSize);
        iconLabel_->setPixmap(pm);

        mainLayout->addWidget(statusLabel_);
        mainLayout->addWidget(iconLabel_, 1, Qt::AlignCenter);

        QDialogButtonBox* buttonBox = new QDialogButtonBox;
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Ok);
        VERIFY(connect(buttonBox, &QDialogButtonBox::accepted, this, &ConnectionDiagnosticDialog::accept));

        mainLayout->addWidget(buttonBox);
        setFixedSize(QSize(fix_width, fix_height));
        setLayout(mainLayout);

        glassWidget_ = new fasto::qt::gui::GlassWidget(GuiFactory::instance().pathToLoadingGif(), trTryToConnect, 0.5, QColor(111, 111, 100), this);
        testConnection(connection);
    }
开发者ID:TakedWind,项目名称:fastoredis,代码行数:36,代码来源:connection_diagnostic_dialog.cpp


注:本文中的QDialogButtonBox::setOrientation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。