DelegateConfigWrapper::DelegateConfigWrapper( QWidget* conf, const QString& title, QWidget* parent, Qt::WindowFlags flags ) : QDialog( parent, flags ) , m_widget( conf ) , m_deleted( false ) { m_widget->setWindowFlags( Qt::Sheet ); #ifdef Q_WS_MAC m_widget->setVisible( true ); #endif setWindowTitle( title ); QVBoxLayout* v = new QVBoxLayout( this ); v->setContentsMargins( 0, 0, 0, 0 ); v->addWidget( m_widget ); m_buttons = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this ); m_okButton = m_buttons->button( QDialogButtonBox::Ok ); connect( m_buttons, SIGNAL( clicked( QAbstractButton*) ), this, SLOT( closed( QAbstractButton* ) ) ); connect( this, SIGNAL( rejected() ), this, SLOT( rejected() ) ); v->addWidget( m_buttons ); setLayout( v ); #ifdef Q_WS_MAC setSizeGripEnabled( false ); setMinimumSize( sizeHint() ); setMaximumSize( sizeHint() ); // to remove the resize grip on osx this is the only way if( conf->metaObject()->indexOfSignal( "sizeHintChanged()" ) > -1 ) connect( conf, SIGNAL( sizeHintChanged() ), this, SLOT( updateSizeHint() ) ); #else m_widget->setVisible( true ); #endif }
MatDBAboutDialog::MatDBAboutDialog(QWidget *parent) : QWizard(parent) { #ifdef Q_WS_MAC this->setParent(qApp->focusWidget()); this->setWindowModality(Qt::WindowModal); this->setWindowFlags(Qt::Sheet); setWizardStyle(ModernStyle); #endif setFixedWidth(900); setFixedHeight(450); setSizeGripEnabled(false); setPage(Page_Version, new VersionPage); setPage(Page_License, new LicensePage); setStartId(Page_Version); QList<QWizard::WizardButton> layout; layout << QWizard::Stretch << QWizard::FinishButton << QWizard::NextButton; setButtonLayout(layout); QPixmap pix(":/artwork/MatDBAbout.png"); setPixmap(QWizard::WatermarkPixmap, pix); setPixmap(QWizard::LogoPixmap, pix); setPixmap(QWizard::BannerPixmap, pix); setPixmap(QWizard::BackgroundPixmap, pix); }
fitDialog::fitDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "fitDialog" ); setCaption(tr("QtiPlot - Non-linear curve fit")); setSizeGripEnabled( true ); tw = new QWidgetStack( this, "tw" ); tw->setSizePolicy(QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred, 2, 0, FALSE )); initEditPage(); initFitPage(); tw->addWidget(editPage, 0); tw->addWidget(fitPage, 1); QVBoxLayout* hlayout = new QVBoxLayout(this, 5, 5, "hlayout"); hlayout->addWidget(tw); setBuiltInFunctionNames(); setBuiltInFunctions(); categoryBox->setCurrentItem(2); funcBox->setCurrentItem(0); loadPlugins(); }
void QPreviewFileDialog::initDlg() { ImageIOSupporter iisup; QStringList filters; QString qs; if(mPreviewMode) { QWidget* widget = new QWidget(this); QVBoxLayout* qvbl = new QVBoxLayout(widget); mpPreviewCheckBox = new QCheckBox(tr("Show preview"),widget); connect(mpPreviewCheckBox,SIGNAL(toggled(bool)), this,SLOT(slotShowPreview(bool))); mpPixWidget = new QLabel(widget); mpPixWidget->setMinimumWidth(200); qvbl->setMargin(5); qvbl->addWidget(mpPreviewCheckBox); qvbl->addWidget(mpPixWidget); qvbl->setStretchFactor (mpPixWidget,1); mpPixWidget->setPalette(QColor(lightGray)); addLeftWidget(widget); resize(550,300); } mImageFormat =xmlConfig->stringValue("VIEWER_IMAGE_TYPE","ALL_FILES"); filters = iisup.getOrderedOutFilterList(mImageFormat); setDir(xmlConfig->stringValue("SINGLEFILE_SAVE_PATH")); setFilters(filters); setMode(QFileDialog::AnyFile); setSizeGripEnabled(false); setViewMode((QFileDialog::ViewMode)xmlConfig->intValue("SINGLEFILE_VIEW_MODE")); }
HelpMessageBox::HelpMessageBox(QWidget *parent) : QMessageBox(parent) { header = tr("HappyCoin-Qt") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()) + "\n\n" + tr("Usage:") + "\n" + " HappyCoin-qt [" + tr("command-line options") + "] " + "\n"; coreOptions = QString::fromStdString(HelpMessage()); uiOptions = tr("UI options") + ":\n" + " -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + " -min " + tr("Start minimized") + "\n" + " -splash " + tr("Show splash screen on startup (default: 1)") + "\n"; setWindowTitle(tr("HappyCoin-Qt")); setFont(bitcoinAddressFont()); setTextFormat(Qt::PlainText); // setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider. setText(header + QString(QChar(0x2003)).repeated(50)); setDetailedText(coreOptions + "\n" + uiOptions); addButton("OK", QMessageBox::RejectRole); //кнопка OK будет справа от кнопки "Скрыть подробности" //addButton("OK", QMessageBox::NoRole); //кнопка OK будет слева от кнопки "Скрыть подробности" setMouseTracking(true); setSizeGripEnabled(true); }
/* * Constructs a dlgOptions as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ dlgOptions::dlgOptions( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "dlgOptions" ); setSizeGripEnabled( TRUE ); dlgOptionsLayout = new QGridLayout( this, 1, 1, 5, 5, "dlgOptionsLayout"); Layout5 = new QVBoxLayout( 0, 0, 6, "Layout5"); buttonOk = new QPushButton( this, "buttonOk" ); buttonOk->setAutoDefault( TRUE ); buttonOk->setDefault( TRUE ); Layout5->addWidget( buttonOk ); buttonCancel = new QPushButton( this, "buttonCancel" ); buttonCancel->setAutoDefault( TRUE ); Layout5->addWidget( buttonCancel ); buttonHelp = new QPushButton( this, "buttonHelp" ); buttonHelp->setAutoDefault( TRUE ); Layout5->addWidget( buttonHelp ); Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); Layout5->addItem( Spacer1 ); dlgOptionsLayout->addMultiCellLayout( Layout5, 0, 1, 1, 1 ); LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setMinimumSize( QSize( 0, 70 ) ); LineEdit1->setPaletteBackgroundColor( QColor( 220, 220, 220 ) ); LineEdit1->setFocusPolicy( QLineEdit::NoFocus ); LineEdit1->setAlignment( int( QLineEdit::AlignAuto ) ); LineEdit1->setReadOnly( TRUE ); dlgOptionsLayout->addWidget( LineEdit1, 1, 0 ); taProps = new QTable( this, "taProps" ); taProps->setNumCols( taProps->numCols() + 1 ); taProps->horizontalHeader()->setLabel( taProps->numCols() - 1, tr( "Property" ) ); taProps->setNumCols( taProps->numCols() + 1 ); taProps->horizontalHeader()->setLabel( taProps->numCols() - 1, tr( "Value" ) ); taProps->setNumRows( 0 ); taProps->setNumCols( 2 ); taProps->setSorting( FALSE ); taProps->setSelectionMode( QTable::SingleRow ); dlgOptionsLayout->addWidget( taProps, 0, 0 ); languageChange(); resize( QSize(322, 384).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); // tab order setTabOrder( buttonOk, buttonCancel ); setTabOrder( buttonCancel, buttonHelp ); setTabOrder( buttonHelp, LineEdit1 ); }
SymbolDialog::SymbolDialog(CharSet charSet, QWidget* parent, Qt::WFlags fl ) : QDialog( parent, fl ) { setAttribute(Qt::WA_DeleteOnClose); setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); setSizeGripEnabled( false ); buttons = new QButtonGroup(this); mainLayout = new QVBoxLayout(this); gridLayout = new QGridLayout(); if (charSet == SymbolDialog::lowerGreek) initLowerGreekChars(); else if (charSet == SymbolDialog::upperGreek) initUpperGreekChars(); else if (charSet == SymbolDialog::mathSymbols) initMathSymbols(); else if (charSet == SymbolDialog::arrowSymbols) initArrowSymbols(); else initNumberSymbols(); closeButton = new QPushButton(tr("&Close"), this); mainLayout->addLayout( gridLayout ); mainLayout->addStretch(); mainLayout->addWidget( closeButton ); languageChange(); connect(buttons, SIGNAL(buttonClicked(int)), this, SLOT(getChar(int))); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QShortcut *shortcut = new QShortcut(Qt::Key_Return, this); connect( shortcut , SIGNAL(activated()), this, SLOT(addCurrentChar()) ); }
polynomFitDialog::polynomFitDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "polynomFitDialog" ); setCaption(tr("QtiPlot - Polynomial Fit Options")); setSizeGripEnabled(true); setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); GroupBox1 = new QButtonGroup( 2,QGroupBox::Horizontal,tr(""),this,"GroupBox1" ); GroupBox1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); new QLabel( tr("Polynomial Fit of"), GroupBox1, "TextLabel1",0 ); boxName = new QComboBox(GroupBox1, "boxShow" ); new QLabel( tr("Order (1 - 9, 1 = linear)"), GroupBox1, "TextLabel2",0 ); boxOrder = new QSpinBox(1,9,1,GroupBox1, "boxOrder" ); boxOrder->setValue(2); new QLabel( tr("Fit curve # pts"), GroupBox1, "TextLabel3",0 ); boxPoints = new QSpinBox(1,1000,50,GroupBox1, "boxPoints" ); new QLabel( tr("Fit curve Xmin"), GroupBox1, "TextLabel4",0 ); boxStart = new QLineEdit(GroupBox1, "boxStart" ); boxStart->setText(tr("0")); new QLabel( tr("Fit curve Xmax"), GroupBox1, "TextLabel5",0 ); boxEnd = new QLineEdit(GroupBox1, "boxEnd" ); new QLabel( tr("Color"), GroupBox1, "TextLabel52",0 ); boxColor = new ColorBox( FALSE, GroupBox1); boxColor->setColor(QColor(red)); new QLabel( tr( "Show Formula on Graph?" ), GroupBox1, "TextLabel6",0 ); boxShowFormula = new QCheckBox(GroupBox1, "boxShow" ); boxShowFormula->setChecked( FALSE ); GroupBox2 = new QButtonGroup(1,QGroupBox::Horizontal,tr(""),this,"GroupBox2" ); GroupBox2->setFlat (TRUE); GroupBox2->setLineWidth (0); buttonFit = new QPushButton(GroupBox2, "buttonFit" ); buttonFit->setAutoDefault( TRUE ); buttonFit->setDefault( TRUE ); buttonCancel = new QPushButton(GroupBox2, "buttonCancel" ); buttonCancel->setAutoDefault( TRUE ); QHBoxLayout* hlayout = new QHBoxLayout(this,5,5, "hlayout"); hlayout->addWidget(GroupBox1); hlayout->addWidget(GroupBox2); languageChange(); setMaximumHeight(GroupBox1->height()); // signals and slots connections connect( buttonFit, SIGNAL( clicked() ), this, SLOT( fit() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( boxName, SIGNAL( activated(int) ), this, SLOT(activateCurve(int))); }
//-- Dialog::Dialog() : QDialog(0, Qt::Dialog | Qt::WindowMinimizeButtonHint), m_thread(NULL), m_display_color(NULL), m_display_depth(NULL), m_ui(new Ui::Dialog()), m_kinect_initialized(false), m_kinect_angle(0), m_color_next_frame_event(NULL), m_depth_next_frame_event(NULL), m_color_stream_handle(NULL), m_depth_stream_handle(NULL) { // [rad] Setup ui for this dialog. setupUi(); setWindowTitle(tr("Kinect Demo 02: Camera")); // [rad] Disable resizing. setSizeGripEnabled(false); setFixedSize(width(), height()); // [rad] Initialize kinect. kinectInitialize(); }
QedStatusBar::QedStatusBar() { QFont *font = QedApp::globalFont(); setFont(*font); setFixedHeight(buttonSize()); setSizeGripEnabled(false); my.timeButton = new QedTimeButton(this); my.timeButton->setFixedSize(QSize(buttonSize(), buttonSize())); my.timeButton->setWhatsThis(QApplication::translate("PmChart", "VCR state button, also used to display the time control window.", 0, QApplication::UnicodeUTF8)); my.timeFrame = new QToolButton(this); my.timeFrame->setMinimumSize(QSize(buttonSize(), buttonSize())); my.timeFrame->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); my.timeFrame->setWhatsThis(QApplication::translate("PmChart", "Unified time axis, displaying the current time position at the " "rightmost point, and either status information or the timeframe " "covering all Visible Points to the left", 0, QApplication::UnicodeUTF8)); delete layout(); QHBoxLayout *box = new QHBoxLayout; box->setMargin(0); box->setSpacing(1); box->addWidget(my.timeButton); box->addWidget(my.timeFrame); setLayout(box); my.gadgetLabel = new QLabel(my.timeFrame); my.gadgetLabel->setFont(*font); my.gadgetLabel->hide(); // shown with gadget Views my.dateLabel = new QLabel(my.timeFrame); my.dateLabel->setIndent(8); my.dateLabel->setFont(*font); my.dateLabel->setAlignment(Qt::AlignRight | Qt::AlignBottom); my.labelSpacer = new QSpacerItem(10, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); my.rightSpacer = new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); my.valueLabel = new QLabel(my.timeFrame); my.valueLabel->setIndent(8); my.valueLabel->setFont(*font); my.valueLabel->setAlignment(Qt::AlignLeft | Qt::AlignBottom); my.grid = new QGridLayout; // Grid of [5 x 3] cells my.grid->setMargin(0); my.grid->setSpacing(0); my.grid->addWidget(my.gadgetLabel, 0, 0, 1, 3); my.grid->addWidget(my.dateLabel, 2, 2, 1, 1); // bottom row, last two cols my.grid->addItem(my.labelSpacer, 2, 1, 1, 1); // bottom row, second column my.grid->addWidget(my.valueLabel, 2, 0, 1, 1); // bottom row, first column. my.grid->addItem(my.rightSpacer, 0, 4, 2, 1); // all rows, in final column my.timeFrame->setLayout(my.grid); }
PrivateChatDialog::PrivateChatDialog(QWidget * parent) : QDialog(parent) { m_name_w = new QLineEdit; m_owner_w = new QLineEdit; m_owner_w->setReadOnly(true); QListView * listView = new QListView; listView->setModel(&m_model); QFormLayout * formLayout = new QFormLayout; formLayout->addRow(tr("&Name : "), m_name_w); formLayout->addRow(tr("&Owner : "), m_owner_w); formLayout->addRow(tr("&Player : "), listView); m_buttonBox = new QDialogButtonBox; connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QVBoxLayout * mainLayout = new QVBoxLayout; mainLayout->addLayout(formLayout); mainLayout->addWidget(m_buttonBox); setLayout(mainLayout); setSizeGripEnabled(true); }
symbolDialog::symbolDialog(CharSet charsSet, QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "symbolDialog" ); setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, sizePolicy().hasHeightForWidth() ) ); setSizeGripEnabled( FALSE ); GroupBox1 = new QButtonGroup(5, QGroupBox::Horizontal,tr(""), this,"GroupBox1" ); GroupBox1->setFlat ( true ); GroupBox1->setLineWidth ( 0 ); GroupBox1->moveFocus (0); if (!charsSet) initMinGreekChars(); else initMajGreekChars(); QHBoxLayout* hlayout = new QHBoxLayout(this, 0, 0, "hlayout2"); hlayout->addWidget(GroupBox1); languageChange(); connect (GroupBox1, SIGNAL(clicked(int)), this, SLOT(getChar(int))); QAccel *accel = new QAccel(this); accel->connectItem( accel->insertItem( Key_Return ), this, SLOT(addCurrentChar()) ); }
PrefsDialogBase::PrefsDialogBase( QWidget* parent ) : QDialog( parent ) { setModal(true); counter = 0; setWindowIcon(QIcon(loadIcon("AppIcon.png"))); setSizeGripEnabled( true ); prefsLayout = new QVBoxLayout( this ); prefsLayout->setMargin(10); prefsLayout->setSpacing(5); layout3 = new QHBoxLayout; layout3->setMargin(0); layout3->setSpacing(5); prefsSelection = new OptionListWidget( this ); layout3->addWidget( prefsSelection ); layout5 = new QVBoxLayout; layout5->setMargin(0); layout5->setSpacing(5); tabNameLabel = new QLabel( this ); QFont f(tabNameLabel->font()); f.setPointSize(f.pointSize()+4); f.setBold(true); tabNameLabel->setFont(f); tabNameLabel->setText(""); layout5->addWidget( tabNameLabel ); prefsWidgets = new QStackedWidget( this); layout5->addWidget( prefsWidgets ); layout3->addLayout(layout5); prefsLayout->addLayout( layout3 ); layout4 = new QHBoxLayout; layout4->setMargin(0); layout4->setSpacing(5); saveButton = new QPushButton(this ); saveButton->setAutoDefault( false ); saveButton->setDefault( false ); layout4->addWidget(saveButton); QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout4->addItem( spacer ); backToDefaults = new QPushButton( this ); backToDefaults->setAutoDefault( false ); backToDefaults->setDefault( false ); layout4->addWidget( backToDefaults ); applyChangesButton = new QPushButton( this ); applyChangesButton->setAutoDefault( false ); applyChangesButton->setDefault( false ); layout4->addWidget( applyChangesButton ); buttonOk = new QPushButton( this ); buttonOk->setAutoDefault( false ); buttonOk->setDefault( false ); layout4->addWidget( buttonOk ); buttonCancel = new QPushButton( this ); buttonCancel->setAutoDefault( false ); buttonCancel->setDefault( false ); layout4->addWidget( buttonCancel ); prefsLayout->addLayout( layout4 ); languageChange(); connect(prefsSelection, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(itemSelected(QListWidgetItem* ))); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveButton_clicked())); }
GenericArrayWidget<S>::GenericArrayWidget( QString name, QString type, const RCP<const ParameterEntryValidator> validator, QWidget *parent): QDialog(parent), type(type), name(name), entryValidator(validator) { setModal(true); setSizeGripEnabled(true); arrayContainer = new QWidget(this); QScrollArea *scrollArea = new QScrollArea(this); scrollArea->setWidget(arrayContainer); scrollArea->setWidgetResizable(true); QPushButton *doneButton = new QPushButton(tr("Done")); QPushButton *cancelButton = new QPushButton(tr("Cancel")); connect(doneButton, SIGNAL(clicked(bool)), this, SLOT(accept())); connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(reject())); QGridLayout *layout = new QGridLayout(this); layout->addWidget(scrollArea,0,0,1,3); layout->addWidget(doneButton,1,2); layout->addWidget(cancelButton,1,1); this->setLayout(layout); setWindowTitle(name); }
ApplyChangesWidget::ApplyChangesWidget(QWidget* parent) : QDialog(parent), d(new ApplyChangesWidgetPrivate(this)) { setSizeGripEnabled(true); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); auto mainLayout = new QVBoxLayout(this); auto okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, &QDialogButtonBox::accepted, this, &ApplyChangesWidget::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &ApplyChangesWidget::reject); QWidget* w=new QWidget(this); d->m_info=new QLabel(w); d->m_documentTabs = new QTabWidget(w); connect(d->m_documentTabs, &QTabWidget::currentChanged, this, &ApplyChangesWidget::indexChanged); QVBoxLayout* l = new QVBoxLayout(w); l->addWidget(d->m_info); l->addWidget(d->m_documentTabs); mainLayout->addWidget(w); mainLayout->addWidget(buttonBox); resize(QSize(800, 400)); }
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent) { QGridLayout* grid = new QGridLayout; QPushButton* ok = new QPushButton("Ok", this); ok->setDefault(true); QString s; s = QCoreApplication::organizationName(); s += "\n"; s += QCoreApplication::applicationName(); s += " version: "; s += QCoreApplication::applicationVersion(); QLabel* label = new QLabel(s); grid->addWidget(label, 0, 0, 1, 2, Qt::AlignLeft); grid->addWidget(ok, 1, 1,Qt::AlignRight|Qt::AlignBottom); setLayout(grid); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); setSizeGripEnabled(true); resize(minimumSizeHint()); }
MessageHelpBox::MessageHelpBox( QWidget *parent, QString title ) : QDialog(parent) { setWindowTitle( title ); setModal( true ); //setAttribute( Qt::WA_DeleteOnClose ); setSizeGripEnabled( true ); QGridLayout * grid = new QGridLayout(this); QLabel *icon = new QLabel(this); icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information)); icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop); grid->addWidget(icon, 0, 0, Qt::AlignTop); m_display = new QTextEdit(this); m_display->setReadOnly( true ); grid->addWidget(m_display, 0, 1); m_showAgain = new QCheckBox(this); m_showAgain->setChecked(true); m_showAgain->setText(tr("&Show this message again")); grid->addWidget(m_showAgain, 1, 1, Qt::AlignTop); QPushButton *ok = new QPushButton(this); ok->setText(tr("&OK")); ok->setFocus(); grid->addWidget(ok, 2, 0, 1, 2, Qt::AlignCenter); grid->setColumnStretch(1, 42); grid->setRowStretch(0, 42); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); }
Trashdialog::Trashdialog(QWidget *parent) : QDialog(parent) { setSizeGripEnabled(true); setWindowModality(Qt::WindowModal); read_settings(); init(); }
PasswordDialog::PasswordDialog(QWidget* parent) : QDialog(parent) { QGridLayout* gridLayout = new QGridLayout(); QLabel* userNameLabel = new QLabel(QString("Username:"******"Password:"******"OK")); okButton->setDefault(true); QPushButton* cancelButton = new QPushButton(QString("Cancel")); buttonLayout->addWidget(okButton); buttonLayout->addWidget(cancelButton); gridLayout->addWidget(userNameLabel, 0, 0); gridLayout->addWidget(m_userNameLineEdit, 0, 1); gridLayout->addWidget(passwordLabel, 1, 0); gridLayout->addWidget(m_passwordLineEdit, 1, 1); gridLayout->addLayout(buttonLayout, 2, 0, 1, 0); setLayout(gridLayout); setWindowTitle(QString("Enter password")); setSizeGripEnabled(false); adjustSize(); connect(okButton, SIGNAL(released()), this, SLOT(accept())); connect(cancelButton, SIGNAL(released()), this, SLOT(reject())); }
FitDialog::FitDialog( QWidget* parent, Qt::WFlags fl ) : QDialog( parent, fl ) { setWindowTitle(tr("Fit Wizard")); setSizeGripEnabled( true ); d_user_function_names = QStringList(); d_user_functions = QStringList(); d_user_function_params = QStringList(); d_fitter = 0; tw = new QStackedWidget(); initEditPage(); initFitPage(); initAdvancedPage(); QVBoxLayout* vl = new QVBoxLayout(); vl->addWidget(tw); setLayout(vl); setBuiltInFunctionNames(); setBuiltInFunctions(); categoryBox->setCurrentRow (2); funcBox->setCurrentRow (0); loadPlugins(); }
// Subclass QProgressDialog() MyQProgressDialog::MyQProgressDialog(LPCSTR titleText, LPCSTR labelText, LPCSTR styleSheet, LPCSTR icon) : QProgressDialog(labelText, CANCEL, 0, 100, QApplication::activeWindow(), 0), m_isCanceled(FALSE), m_indeterminateMode(FALSE), m_lastProgress(-1), m_hMouseHook(NULL), m_hWinHook(NULL), m_hTimerQueue(NULL), m_hUpdateTimer(NULL) { setWindowTitle(titleText); setAutoReset(FALSE); setAutoClose(FALSE); setWindowModality(Qt::WindowModal); setFixedSize(DAILOG_WIDTH, DAILOG_HEIGHT); setSizeGripEnabled(FALSE); // Qt::Tool -- Smaller title bar with smaller 'X' // Qt::Popup -- Boarderless // Qt::SubWindow -- Nonmodal on top with no background //setWindowFlags(Qt::Tool); // Nix the title bar help button setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) | Qt::WindowMinimizeButtonHint); // This time must elapse before dialog shows (default 4sec) setMinimumDuration(SHOW_DELAY); // Set dialog font (and children inherit) QFont fnt(FONT, 10, QFont::Normal); fnt.setStyleStrategy(QFont::PreferAntialias); setFont(fnt); // Put the progress text in the middle if (QProgressBar *bar = findChild<QProgressBar *>()) bar->setAlignment(Qt::AlignCenter); // Optionally set Qt style sheet if (styleSheet && styleSheet[0]) { // From a file? if (strncmp(styleSheet, "url(", 4) == 0) { QString fn(styleSheet + (sizeof("url(") - 1)); fn.chop(1); QFile f(fn); if (f.open(QFile::ReadOnly | QFile::Text)) setStyleSheet(QTextStream(&f).readAll()); } else // No, string setStyleSheet(styleSheet); } // Optionally set titlebar icon if (icon && icon[0]) setWindowIcon(QIcon(icon)); // Progress 0 for the control to setup internally setValue(0); // Start update interval timer if (m_hTimerQueue = CreateTimerQueue()) CreateTimerQueueTimer(&m_hUpdateTimer, m_hTimerQueue, (WAITORTIMERCALLBACK)timerTick, NULL, TARGET_UPDATE_MS, TARGET_UPDATE_MS, 0); _ASSERT(m_hUpdateTimer != NULL); }
QChangeNumberTileColumnsDialog::QChangeNumberTileColumnsDialog(int* tileCount) : tileCount(tileCount) { setLayout(&dialogGridLayout); setWindowTitle("Set number of columns per row"); setSizeGripEnabled(false); layout()->setSizeConstraint( QLayout::SetFixedSize ); lTextLineEdit.setText("number of columns per row"); spNumberTiles.setAcceptDrops(false); spNumberTiles.setMinimum(1); spNumberTiles.setMaximum(10); spNumberTiles.setToolTip("Sets the number of placeable parameters per row."); spNumberTiles.setValue(*tileCount); spNumberTiles.setSingleStep(1); spNumberTiles.setFont(QFont("Courier", 11, QFont::Normal)); buttonBox.addButton(QDialogButtonBox::Ok); buttonBox.addButton(QDialogButtonBox::Cancel); connect(&buttonBox, SIGNAL(accepted()), this, SLOT(sl_dialogAccept())); connect(&buttonBox, SIGNAL(rejected()), this, SLOT(reject())); dialogGridLayout.addWidget(&lTextLineEdit, 0, 0, Qt::AlignRight); dialogGridLayout.addWidget(&spNumberTiles, 0, 1, Qt::AlignLeft); dialogGridLayout.addWidget(&buttonBox, 1, 0, 1, 2); }
/** * Constructor */ FindReplaceDialog::FindReplaceDialog(ScriptEditor *editor, Qt::WFlags fl) : QDialog(editor, fl), m_editor(editor), m_findInProgress(false) { initLayout(); setSizeGripEnabled(true); }
PlotSettingsDialog:: PlotSettingsDialog( const std::vector<QwtPlot*>& plot_widgets, QWidget* parent, const char* name, bool modal ) : QDialog( parent ), plots_( plot_widgets ) { setupUi(this); if(name) setObjectName(name); setModal(modal); plots_list_->setSelectionMode( QAbstractItemView::ExtendedSelection ); plots_list_->setHidden( true ); xgroupbox_->setHidden( true ); ygroupbox_->setHidden( true ); for( unsigned int plot_id = 0 ; plot_id < plots_.size() ; plot_id++ ) { plots_list_->addItem( plots_[plot_id]->title().text() ); } QObject::connect( ok_button_, SIGNAL( clicked() ), this, SLOT( accept() ) ); QObject::connect( cancel_button_, SIGNAL( clicked() ), this, SLOT( reject() ) ); setSizeGripEnabled( true ); }
FFTDialog::FFTDialog(int type, QWidget* parent, Qt::WFlags fl ) : QDialog( parent, fl ) { setWindowTitle(tr("QtiPlot - FFT Options")); setSizeGripEnabled( true ); d_matrix = 0; d_table = 0; graph = 0; d_type = type; forwardBtn = new QRadioButton(tr("&Forward")); forwardBtn->setChecked( true ); backwardBtn = new QRadioButton(tr("&Inverse")); QHBoxLayout *hbox1 = new QHBoxLayout(); hbox1->addWidget(forwardBtn); hbox1->addWidget(backwardBtn); hbox1->addStretch(); QGroupBox *gb1 = new QGroupBox(); gb1->setLayout(hbox1); QGridLayout *gl1 = new QGridLayout(); if (d_type == onGraph) gl1->addWidget(new QLabel(tr("Curve")), 0, 0); else if (d_type == onTable) gl1->addWidget(new QLabel(tr("Sampling")), 0, 0); if (d_type != onMatrix){ boxName = new QComboBox(); connect( boxName, SIGNAL( activated(const QString&) ), this, SLOT( activateCurve(const QString&) ) ); gl1->addWidget(boxName, 0, 1); setFocusProxy(boxName); }
ScFileWidget::ScFileWidget(QWidget * parent) : QFileDialog(parent, Qt::Widget) { setSizeGripEnabled(false); setModal(false); setViewMode(QFileDialog::List); setWindowFlags(Qt::Widget); #ifdef Q_OS_MAC QList<QUrl> urls; QUrl computer(QUrl::fromLocalFile(QLatin1String(""))); if (!urls.contains(computer)) urls << computer; QUrl volumes(QUrl::fromLocalFile("/Volumes")); if (!urls.contains(volumes)) urls << volumes; //desktop too? QUrl computer(QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))); setSidebarUrls(urls); #endif QList<QPushButton *> b = findChildren<QPushButton *>(); QListIterator<QPushButton *> i(b); while (i.hasNext()) i.next()->setVisible(false); setMinimumSize(QSize(480, 310)); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); }
MonitorWindow::MonitorWindow(QWidget* inParent) : QDialog(inParent, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowSystemMenuHint) { setAttribute(Qt::WA_DeleteOnClose, true); setSizeGripEnabled(true); setWindowIcon(QIcon(":/images/monitor")); mMonitorLabel = QString(tr("Monitor%1")).arg(getID()); setWindowTitle(mMonitorLabel); mMonitorAccessAction = NULL; mZoomChange = true; mCurrentModuleIndex = -1; mCurrentModuleSlotIndex = -1; mImageWidth = 0; mImageHeight = 0; mImageDepth = Image::eDepthUndefined; mImageNbChannels = Image::eChannel0; mImageColorModel = Image::eModelUndefined; mImageTmp = NULL; mImageTmpData = NULL; createActions(); createLayout(); mImageState = eImageStateNone; updateImageState(eImageStateNoModule); }
DelegateConfigWrapper::DelegateConfigWrapper( Tomahawk::Accounts::Account* account, QWidget* parent, Qt::WindowFlags flags ) : QDialog( parent, flags ) , m_account( account ) , m_widget( account->configurationWidget() ) , m_aboutW( account->aboutWidget() ) , m_buttons( nullptr ) , m_okButton( nullptr ) , m_deleteButton( nullptr ) , m_errorLabel( new QLabel( this ) ) , m_deleted( false ) { setWindowTitle( tr("%1 Config", "Window title for account config windows" ).arg( account->accountFriendlyName() ) ); QVBoxLayout* v = new QVBoxLayout( this ); v->setContentsMargins( 0, 0, 0, 0 ); v->addWidget( m_widget ); v->addStretch(); QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok | QDialogButtonBox::Cancel; if ( m_aboutW ) { m_aboutW->hide(); buttons |= QDialogButtonBox::Help; } m_buttons = new QDialogButtonBox( buttons, Qt::Horizontal, this ); m_okButton = m_buttons->button( QDialogButtonBox::Ok ); connect( m_buttons, SIGNAL( clicked( QAbstractButton*) ), this, SLOT( closed( QAbstractButton* ) ) ); connect( this, SIGNAL( rejected() ), this, SLOT( rejected() ) ); if ( m_aboutW ) { connect( m_buttons->button( QDialogButtonBox::Help ), SIGNAL( clicked( bool ) ), this, SLOT( aboutClicked( bool ) ) ); m_buttons->button( QDialogButtonBox::Help )->setText( tr( "About" ) ); } QHBoxLayout* h = new QHBoxLayout( this ); h->addWidget( m_buttons ); if ( m_widget && m_widget->layout() ) h->setContentsMargins( m_widget->layout()->contentsMargins() ); else if ( m_widget ) h->setContentsMargins( m_widget->contentsMargins() ); m_errorLabel->setAlignment( Qt::AlignCenter ); m_errorLabel->setWordWrap( true ); v->addWidget( m_errorLabel ); v->addLayout( h ); setLayout( v ); m_widget->setVisible( true ); setSizeGripEnabled( false ); updateSizeHint(); if ( m_widget->metaObject()->indexOfSignal( "sizeHintChanged()" ) > -1 ) connect( m_widget, SIGNAL( sizeHintChanged() ), this, SLOT( updateSizeHint() ) ); connect( m_account, SIGNAL( configTestResult( Tomahawk::Accounts::ConfigTestResultType ) ), SLOT( onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType ) ) ); }
void StatusBarWidget::optionChanged(const QString &option, const QVariant &value) { if (option == QLatin1String("Interface/ShowSizeGrip")) { setSizeGripEnabled(value.toBool()); updateSize(); } }
void StatusBar::createLayout() { setFixedHeight(ui::statusBarHeight()); layout()->setSpacing(4); layout()->setContentsMargins(1, 2, 1, 0); setSizeGripEnabled(false); setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum); }