PinDialog::PinDialog( const QString &title, const QString & label, Device *cryptostick, Usage usage, PinType pinType, bool ShowMatrix, QWidget *parent) : cryptostick(cryptostick), _usage(usage), _pinType(pinType), QDialog(parent), ui(new Ui::PinDialog) { ui->setupUi(this); connect(ui->okButton, SIGNAL(clicked()), this, SLOT(onOkButtonClicked())); // Setup pwd-matrix ui->checkBox_PasswordMatrix->setCheckState(Qt::Unchecked); if (FALSE == ShowMatrix) { ui->checkBox_PasswordMatrix->hide(); } // Setup title and label this->setWindowTitle(title); ui->label->setText(label); //ui->status->setVisible(false); updateTryCounter(); ui->lineEdit->setFocus(); }
void LoginSettingWidget::initWidgets() { dest_addr_label = new QLabel(); dest_port_label = new QLabel(); dest_addr_edit = new QLineEdit(); dest_port_edit = new QLineEdit(); dest_addr_edit->setAlignment(Qt::AlignLeft); dest_port_edit->setAlignment(Qt::AlignLeft); dest_addr_edit->setFixedWidth(120); dest_port_edit->setFixedWidth(120); dest_addr_edit->setPlaceholderText(tr("Enter Target Device IP Address")); dest_port_edit->setPlaceholderText(tr("Enter Target Port Number")); QString ip_regexp("([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}"); QValidator *ip_validator = new QRegExpValidator(QRegExp(ip_regexp)); dest_addr_edit->setValidator(ip_validator); QString port_regexp("^[1-9]$|(^[1-9][0-9]$)|(^[1-9][0-9][0-9]$)|(^[1-9][0-9][0-9][0-9]$)|(^[1-6][0-5][0-5][0-3][0-5]$)"); QValidator *port_validator = new QRegExpValidator(QRegExp(port_regexp)); dest_port_edit->setValidator(port_validator); ok_button = new QPushButton(); cancel_button = new QPushButton(); //cancel_button->setDefault(true); connect(ok_button, SIGNAL(clicked()), this, SLOT(onOkButtonClicked())); connect(cancel_button, SIGNAL(clicked()), this, SIGNAL(showLogin())); }
SGMSettingsMasterView::SGMSettingsMasterView(QWidget *parent) : QWidget(parent) { sgmPluginsLocationView_ = new SGMPluginsLocationView(); sgmDetectorsMasterView_ = new SGMDetectorsMasterView(); connect(sgmPluginsLocationView_, SIGNAL(unsavedChanges(bool)), this, SLOT(onUnsavedChanges(bool))); connect(sgmDetectorsMasterView_, SIGNAL(unsavedChanges(bool)), this, SLOT(onUnsavedChanges(bool))); vl_ = new QVBoxLayout(); vl_->addWidget(sgmPluginsLocationView_); vl_->addWidget(sgmDetectorsMasterView_); applyButton_ = new QPushButton("Apply"); cancelButton_ = new QPushButton("Cancel"); okButton_ = new QPushButton("Ok"); connect(applyButton_, SIGNAL(clicked()), this, SLOT(onApplyButtonClicked())); connect(cancelButton_, SIGNAL(clicked()), this, SLOT(onCancelButtonClicked())); connect(okButton_, SIGNAL(clicked()), this, SLOT(onOkButtonClicked())); QHBoxLayout *hl = new QHBoxLayout(); hl->addWidget(applyButton_); hl->addStretch(4); hl->addWidget(cancelButton_); hl->addWidget(okButton_); vl_->addLayout(hl); setLayout(vl_); }
CalculateWindow::CalculateWindow(QWidget *parent) : QDialog(parent) { if (!TensorStore::getInstance().size()) { throw guiException("You have to add at least one tensor to start a calculation."); } setWindowTitle(tr("Calculate")); setMinimumSize(QSize(MINIMUM_WIDTH, MINIMUM_HEIGHT)); m_comBoxCalcItem = new QComboBox(this); m_comBoxCalcItem->setSizeAdjustPolicy(QComboBox::AdjustToContents); m_comBoxCalcItem->addItems(OperationItems::getAllowableItems()); m_calcReqWidget = new OperationRequirementWidget(this); QVBoxLayout* calcListLayout = new QVBoxLayout; calcListLayout->addWidget(m_comBoxCalcItem, 0, Qt::AlignTop); calcListLayout->addWidget(m_calcReqWidget, 1); m_tensorView = new TabsWidget(this); m_tensorView->setReadOnly(true); QHBoxLayout* listAndTensorViewLayout = new QHBoxLayout; listAndTensorViewLayout->setSpacing(HORIZ_SPACING); listAndTensorViewLayout->addLayout(calcListLayout, 0); listAndTensorViewLayout->addWidget(m_tensorView, 1); m_pushBtnOk = new QPushButton(tr("OK"), this); m_pushBtnOk->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); m_pushBtnCancel = new QPushButton(tr("Cancel"), this); m_pushBtnCancel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); QHBoxLayout* okCancelLayout = new QHBoxLayout; okCancelLayout->addWidget(m_pushBtnOk, 1, Qt::AlignRight); okCancelLayout->addWidget(m_pushBtnCancel, 0, Qt::AlignRight); QVBoxLayout* mainLayout = new QVBoxLayout; mainLayout->addLayout(listAndTensorViewLayout); mainLayout->addLayout(okCancelLayout); mainLayout->setContentsMargins(CONTENT_MARGIN, CONTENT_MARGIN, CONTENT_MARGIN, CONTENT_MARGIN); setLayout(mainLayout); qRegisterMetaType<MatrixVectorExp>("MatrixVectorExp"); connect(m_pushBtnOk, SIGNAL(clicked()), this, SLOT(onOkButtonClicked())); connect(m_pushBtnCancel, SIGNAL(clicked()), this, SLOT(onCancelButtonClicked())); connect(m_comBoxCalcItem, SIGNAL(currentIndexChanged(int)), this, SLOT(onCalcItemCurrentIndexChanged(int))); connect(m_calcReqWidget, SIGNAL(tensorChoosed(QString)), this, SLOT(onReqWidgetTensorChosen(QString))); onCalcItemCurrentIndexChanged(0); }
QLayout *ServerDialog::createButtonLayout() { QHBoxLayout *button_layout = new QHBoxLayout; button_layout->addStretch(); QPushButton *ok_button = new QPushButton(tr("OK")); QPushButton *cancel_button = new QPushButton(tr("Cancel")); button_layout->addWidget(ok_button); button_layout->addWidget(cancel_button); connect(ok_button, SIGNAL(clicked()), this, SLOT(onOkButtonClicked())); connect(cancel_button, SIGNAL(clicked()), this, SLOT(reject())); return button_layout; }
void mpGTui::onEntryEnterKeyRelease() { ROS_DEBUG("enter key released"); onOkButtonClicked(); }
void ParameterDialog::setupConnection() { connect(this->m_ok_button, SIGNAL(clicked()), this, SLOT(onOkButtonClicked())); connect(this->m_cancel_button, SIGNAL(clicked()), this, SLOT(onCancelButtonClicked())); connect(this->m_select_all_the_left_nodes, SIGNAL(stateChanged(int)), this, SLOT(onCheckBoxStateChanged(int))); }
UserRegistrationDialogPrivate::UserRegistrationDialogPrivate(UserRegistrationDialog * dialog) : QObject(dialog), dialog(dialog), avatarChanged(false) { emailConfirmNoticeTemplate = QString( "You will shortly receive a confirmation email to the address you just " "registered (%1). Before you can log in to Utopia Documents for the first " "time, you must follow the instructions in that email to active your " "account." ); dialog->setFixedWidth(500); QVBoxLayout * dialogLayout = new QVBoxLayout(dialog); dialogLayout->setSpacing(0); dialogLayout->setContentsMargins(0, 0, 0, 0); gridLayout = new QGridLayout; gridLayout->setSpacing(8); gridLayout->setContentsMargins(12, 12, 12, 0); dialogLayout->addLayout(gridLayout); QLabel * stepLabel = verticalLabel("Step 1", dialog); gridLayout->addWidget(stepLabel, 0, 0, 9, 1, Qt::AlignLeft); QLabel * msgLabel = new QLabel; msgLabel->setText( "Please provide some personal information about yourself here. You can also " "choose a profile picture for your account. This information will be visible " "to other users." ); msgLabel->setWordWrap(true); gridLayout->addWidget(msgLabel, 1, 1, 1, 4); // Title QLabel * titleLabel = new QLabel("Title:"); gridLayout->addWidget(titleLabel, 2, 1, Qt::AlignRight); title = new QComboBox; title->setEditable(true); gridLayout->addWidget(title, 2, 2); // Forename QLabel * forenameLabel = new QLabel("Forename:"); gridLayout->addWidget(forenameLabel, 3, 1, Qt::AlignRight); forename = new QLineEdit; gridLayout->addWidget(forename, 3, 2); // Surname QLabel * surnameLabel = new QLabel("Surname:"); gridLayout->addWidget(surnameLabel, 4, 1, Qt::AlignRight); surname = new QLineEdit; gridLayout->addWidget(surname, 4, 2); // Institution QLabel * institutionLabel = new QLabel("Institution:"); gridLayout->addWidget(institutionLabel, 5, 1, Qt::AlignRight); institution = new QLineEdit; gridLayout->addWidget(institution, 5, 2); QFrame * avatarFrame = new QFrame; avatarFrame->setObjectName("avatarFrame"); avatarFrame->setFixedSize(128, 128); QVBoxLayout * avatarFrameLayout = new QVBoxLayout(avatarFrame); avatarFrameLayout->setContentsMargins(1, 1, 1, 1); avatar = new QLabel; avatar->setScaledContents(true); avatar->installEventFilter(this); avatar->setCursor(Qt::PointingHandCursor); avatar->setToolTip("Choose picture..."); avatarFrameLayout->addWidget(avatar); gridLayout->addWidget(avatarFrame, 2, 3, 5, 2, Qt::AlignTop | Qt::AlignHCenter); QPushButton * avatarButton = new QPushButton("Choose picture..."); connect(avatarButton, SIGNAL(clicked()), this, SLOT(pickAvatar())); gridLayout->addWidget(avatarButton, 7, 1, 1, 4, Qt::AlignTop | Qt::AlignRight); ///////////////////////////////////////////////////////////////////////////////// // Email address // Email stepLabel = verticalLabel("Step 2", dialog); gridLayout->addWidget(stepLabel, 9, 0, 4, 1, Qt::AlignLeft); emailDisclaimer = new QLabel( "You will use your email address to log in to Utopia. You will need to " "confirm your email address before you can use your account; instructions " "will be emailed to this address." ); emailDisclaimer->setWordWrap(true); gridLayout->addWidget(emailDisclaimer, 10, 1, 1, 4); QLabel * emailLabel = new QLabel("Email address:"); gridLayout->addWidget(emailLabel, 11, 1, Qt::AlignRight); email = new QLineEdit; gridLayout->addWidget(email, 11, 2, 1, 2); emailErrorIcon = new QLabel; emailErrorIcon->setFixedSize(20, 20); gridLayout->addWidget(emailErrorIcon, 11, 4, 1, 1, Qt::AlignCenter); emailErrorText = new QLabel; emailErrorText->setObjectName("errorLabel"); emailErrorText->setWordWrap(true); emailErrorText->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); connect(emailErrorText, SIGNAL(linkActivated(const QString &)), this, SLOT(onLinkActivated(const QString &))); emailErrorText->hide(); gridLayout->addWidget(emailErrorText, 12, 2, 1, 2); stepLabel = verticalLabel("Step 3", dialog); gridLayout->addWidget(stepLabel, 13, 0, 5, 1, Qt::AlignLeft); passwordDisclaimer = new QLabel( "Please choose (and confirm) a password for your new account. A combination " "of letters, numbers and other characters that is not easy to guess will be " "more secure." ); passwordDisclaimer->setWordWrap(true); gridLayout->addWidget(passwordDisclaimer, 14, 1, 1, 4); // Password 1 QLabel * newPassword1Label = new QLabel("Password:"******"Retype password:"******"errorLabel"); newPasswordErrorText->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); newPasswordErrorText->hide(); gridLayout->addWidget(newPasswordErrorText, 17, 2, 1, 2); ///////////////////////////////////////////////////////////////////////////////// // Control buttons QHBoxLayout * buttonLayout = new QHBoxLayout; buttonLayout->setContentsMargins(12, 12, 12, 12); buttonLayout->setSpacing(8); QPushButton * okButton = new QPushButton("Register"); okButton->setDefault(true); connect(okButton, SIGNAL(clicked()), this, SLOT(onOkButtonClicked())); QPushButton * cancelButton = new QPushButton("Cancel"); cancelButton->setDefault(false); connect(cancelButton, SIGNAL(clicked()), this, SLOT(onCancelButtonClicked())); spinner = new Utopia::Spinner; spinner->setFixedSize(18, 18); buttonLayout->addWidget(cancelButton, 0); buttonLayout->addStretch(1); buttonLayout->addWidget(spinner, 0); buttonLayout->addWidget(okButton, 0); dialogLayout->addStretch(1); dialogLayout->addLayout(buttonLayout, 0); // Layout gridLayout->setColumnStretch(0, 0); gridLayout->setColumnStretch(1, 0); gridLayout->setColumnStretch(2, 100); gridLayout->setColumnStretch(3, 1); gridLayout->setColumnStretch(4, 0); gridLayout->setColumnMinimumWidth(0, stepLabel->minimumWidth() + 10); gridLayout->setRowStretch(6, 1); dialog->setFixedHeight(dialog->heightForWidth(500)); dialog->setSizeGripEnabled(false); }