void HelpWidget::placeWidgets() { QLabel *iconLabel = new QLabel(pWidget); iconLabel->setPixmap(QPixmap(":/ArpmanetDC/Resources/Logo.png").scaled(100,100, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); QLabel *gplLabel = new QLabel(pWidget); gplLabel->setPixmap(QPixmap(":/ArpmanetDC/Resources/GPLv3 Logo 128px.png").scaled(48,20, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); QHBoxLayout *aboutLayout = new QHBoxLayout(); aboutLayout->addWidget(iconLabel); QLabel *aboutLabel = new QLabel(tr("<b><a href=\"http://code.google.com/p/arpmanetdc/\">ArpmanetDC</a></b><br/>Version %1 Alpha<br/>Copyright (C) 2012, Arpmanet Community<p>Free software licenced under <a href=\"http://www.gnu.org/licenses/\">GPLv3</a></p>").arg(VERSION_STRING), pWidget); aboutLabel->setOpenExternalLinks(true); QVBoxLayout *aboutVLayout = new QVBoxLayout(); aboutVLayout->addStretch(1); aboutVLayout->addWidget(aboutLabel); aboutVLayout->addWidget(gplLabel); aboutVLayout->addStretch(1); QVBoxLayout *progressLayout = new QVBoxLayout; progressLayout->setAlignment(Qt::AlignCenter); progressLayout->addStretch(1); progressLayout->addWidget(updateLabel); progressLayout->addWidget(progress); progressLayout->addWidget(updateButton); //progressLayout->addStretch(1); aboutLayout->addLayout(aboutVLayout); aboutLayout->addStretch(1); aboutLayout->addLayout(progressLayout); QVBoxLayout *vlayout = new QVBoxLayout(); vlayout->addLayout(aboutLayout); vlayout->addSpacing(20); browser->scrollToAnchor("ArpmanetDC"); vlayout->addWidget(browser); vlayout->setStretchFactor(aboutLayout, 0); vlayout->setStretchFactor(browser, 1); pWidget->setLayout(vlayout); }
CallConfirmWidget::CallConfirmWidget(const QWidget* Anchor, const Friend& f) : QWidget(), anchor(Anchor), f(f), rectW{120}, rectH{85}, spikeW{30}, spikeH{15}, roundedFactor{20}, rectRatio(static_cast<qreal>(rectH)/static_cast<qreal>(rectW)) { setWindowFlags(Qt::SubWindow); setAttribute(Qt::WA_DeleteOnClose); QPalette palette; palette.setColor(QPalette::WindowText, Qt::white); setPalette(palette); QVBoxLayout *layout = new QVBoxLayout(this); QLabel *callLabel = new QLabel(QObject::tr("Incoming call..."), this); callLabel->setStyleSheet("color: white"); callLabel->setWordWrap(true); callLabel->setAlignment(Qt::AlignHCenter); QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Horizontal, this); QPushButton *accept = new QPushButton(this), *reject = new QPushButton(this); accept->setFlat(true); reject->setFlat(true); accept->setStyleSheet("QPushButton{border:none;}"); reject->setStyleSheet("QPushButton{border:none;}"); accept->setIcon(QIcon(":/ui/acceptCall/acceptCall.svg")); reject->setIcon(QIcon(":/ui/rejectCall/rejectCall.svg")); accept->setIconSize(accept->size()); reject->setIconSize(reject->size()); buttonBox->addButton(accept, QDialogButtonBox::AcceptRole); buttonBox->addButton(reject, QDialogButtonBox::RejectRole); connect(buttonBox, &QDialogButtonBox::accepted, this, &CallConfirmWidget::accepted); connect(buttonBox, &QDialogButtonBox::rejected, this, &CallConfirmWidget::rejected); layout->setMargin(12); layout->addSpacing(spikeH); layout->addWidget(callLabel); layout->addWidget(buttonBox); setFixedSize(rectW,rectH+spikeH); reposition(); }
QWidget* PrefsDialog::createProgrammerForm(QList<Platform *> platforms) { QGroupBox * formGroupBox = new QGroupBox(tr("Platform Support")); QVBoxLayout *layout = new QVBoxLayout(); layout->setSpacing(SPACING); foreach (Platform * platform, platforms) { QLabel *platformLb = new QLabel(""); platformLb->setTextFormat(Qt::RichText); platformLb->setText(tr("<b>%1</b>").arg(platform->getName())); layout->addWidget(platformLb); QFrame * locationFrame = new QFrame(formGroupBox); QHBoxLayout * locationLayout = new QHBoxLayout(); locationLayout->setMargin(0); locationLayout->setSpacing(0); locationFrame->setLayout(locationLayout); QLabel *locationLb = new QLabel(tr("Location:")); locationLayout->addWidget(locationLb); locationLayout->addSpacing(SPACING); QLineEdit * locationLE = new QLineEdit(locationFrame); locationLE->setText(platform->getCommandLocation()); locationLayout->addWidget(locationLE); m_programmerLEs.insert(platform->getName(), locationLE); QPushButton * locateBtn = new QPushButton(tr("..."),locationFrame); locationLayout->addWidget(locateBtn); locateBtn->setProperty("platform", platform->getName()); connect(locateBtn, SIGNAL(clicked()), this, SLOT(chooseProgrammer())); layout->addWidget(locationFrame); QLabel *hintLb = new QLabel(""); hintLb->setTextFormat(Qt::RichText); hintLb->setOpenExternalLinks(true); hintLb->setText(tr("You need to have <a href='%1'>%2</a> (version %3 or newer) installed.") .arg(platform->getDownloadUrl().toString()) .arg(platform->getIdeName()) .arg(platform->getMinVersion())); layout->addWidget(hintLb); layout->addSpacing(SPACING); }
MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data) : Popup(data) { const char* title = "select"; if (qstrcmp(title, "weba_ti_textlist_multi")) setWindowTitle(QString::fromUtf8(title)); else setWindowTitle(QLatin1String("Select items")); QHBoxLayout* hLayout = new QHBoxLayout(this); hLayout->setContentsMargins(0, 0, 0, 0); m_list = new QListWidget(this); m_list->setSelectionMode(QAbstractItemView::MultiSelection); populateList(); MultipleItemListDelegate* delegate = new MultipleItemListDelegate(this); m_list->setItemDelegate(delegate); hLayout->addSpacing(gMaemoListPadding); hLayout->addWidget(m_list); QVBoxLayout* vLayout = new QVBoxLayout(); const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count(); vLayout->addSpacing((visibleItemCount - 1) * gMaemoListItemSize); QPushButton* done = new QPushButton(this); title = "done"; if (qstrcmp(title, "wdgt_bd_done")) done->setText(QString::fromUtf8(title)); else done->setText(QLatin1String("Done")); done->setMinimumWidth(178); vLayout->addWidget(done); hLayout->addSpacing(8); hLayout->addLayout(vLayout); hLayout->addSpacing(18); connect(done, SIGNAL(clicked()), this, SLOT(accept())); resize(size().width(), visibleItemCount * gMaemoListItemSize); }
configDialog::configDialog(QWidget* parent): QDialog(parent) { audioFileEdit = new QLineEdit();audioFileEdit->setReadOnly(true); notificationCheck = new QCheckBox("Notification"); connect(notificationCheck,SIGNAL(stateChanged(int)),this,SLOT(notificationCheckChanged(int))); /*xml read*/ XmlParser xf; xf.open(config_file_path); xf.loadXmlData(); audioFileEdit->setText(xf.getAlarmFile()); if(xf.getCheckbox(QString::fromStdString("notification")) == true){ notificationCheck->setChecked(true); }else{ notificationCheck->setChecked(false); } /*--------*/ QString a = QCoreApplication::applicationFilePath(); audioFileEditLabel = new QLabel(tr("audio file")); audioFileEditCallPathDialogButton = new QPushButton(tr("Choice")); connect(audioFileEditCallPathDialogButton,SIGNAL(clicked()),this,SLOT(audioFileEditCallPathDialogButton_is_Pushed())); QHBoxLayout *audioFileEditLayout = new QHBoxLayout(); audioFileEditLayout->addWidget(audioFileEditLabel); audioFileEditLayout->addWidget(audioFileEdit); audioFileEditLayout->addWidget(audioFileEditCallPathDialogButton); QVBoxLayout *checkboxes = new QVBoxLayout(); checkboxes->addWidget(notificationCheck); QVBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->addLayout(audioFileEditLayout); mainLayout->addSpacing(12); mainLayout->addLayout(checkboxes); setLayout(mainLayout); };
void Data_analysis_gui::init_display_area() { QVBoxLayout * vbox = new QVBoxLayout(); display_box_->setLayout(vbox); /* display_box_->setOrientation( Qt::Vertical ); display_box_->setColumns( 3 ); */ QwtText plotname(""); plot_ = new QwtPlot( plotname, display_box_); plot_->axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating); vbox->addWidget(plot_); vbox->addSpacing(12); QPen pen(QColor(150,150,150)); pen.setStyle(Qt::DashLine); curve_id_ = new QwtPlotCurve("curve_id_"); curve_id_->attach(plot_); curve_id_->setAxis(QwtPlot::xBottom, QwtPlot::yLeft); curve_grid_ = new QwtPlotGrid(); curve_grid_->setPen(pen); curve_grid_->enableX(true); curve_grid_->enableY(true); curve_grid_->attach(plot_); // Use a light gray for the grid //plot_->setGridPen( QPen( QColor(150,150,150), 0, Qt::DotLine ) ); // configure the plot axis // enabled by default //plot_->setAxisOptions( QwtPlot::xBottom, QwtAutoScale::Floating ); QFont font = plot_->axisFont( QwtPlot::xBottom ); font.setPointSize( 7 ); plot_->setAxisFont( QwtPlot::xBottom, font ); plot_->setAxisFont( QwtPlot::yLeft, font ); font.setPointSize( 10 ); }
ApplicationDialog::ApplicationDialog(DragWidget *dw) { this->m_dw = dw; contentsWidget = new QListWidget; contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setMovement(QListView::Static); contentsWidget->setMaximumWidth(128); contentsWidget->setSpacing(12); pagesWidget = new QStackedWidget; this->m_ping = new PingPage(this, this->m_dw); pagesWidget->addWidget(this->m_ping); this->m_udpEcho = new UdpEchoPage(this, this->m_dw); pagesWidget->addWidget(this->m_udpEcho); this->m_tcp = new TcpPage(this, this->m_dw); pagesWidget->addWidget(this->m_tcp); QPushButton *closeButton = new QPushButton(tr("Close")); createApplications(); contentsWidget->setCurrentRow(0); connect(closeButton, SIGNAL(clicked()), this, SLOT(quit())); QHBoxLayout *horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget(contentsWidget); horizontalLayout->addWidget(pagesWidget, 1); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(1); buttonsLayout->addWidget(closeButton); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(horizontalLayout); mainLayout->addStretch(1); mainLayout->addSpacing(12); mainLayout->addLayout(buttonsLayout); setLayout(mainLayout); setWindowTitle(tr("Application Dialog")); }
SelectPage::SelectPage(QWidget *parent) : QWidget(parent) , printer_model(0) { this->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::MinimumExpanding); this->setWindowTitle(QObject::trUtf8("Выбор режима работы ...")); QLabel *topLabel = new QLabel(QObject::trUtf8("На этом шаге необходимо выбрать <b>Принтер</b> и один из режимов работы:" "<ul><li>Пометка зарегистрованного документа как БРАК</li><br/>" "<li>Учет листов в БД</li><br/><li>Печать на учтенных листах</li><br/>" "<li>Печать с автоматическим учетом листов</li></ul>" )); topLabel->setWordWrap(true); printersCBox = new QComboBox(this); markBrakDoc = new QRadioButton(this); accountingDoc = new QRadioButton(this); printDoc = new QRadioButton(this); both_step = new QRadioButton(this); markBrakDoc->setText(QObject::trUtf8("Пометка зарегистрированного и распечатанного документа как брак")); markBrakDoc->setEnabled(false); accountingDoc->setText(QObject::trUtf8("Учет листов в БД")); printDoc->setText(QObject::trUtf8("Печать на учтенных листах")); both_step->setText(QObject::trUtf8("Печать на учтенных листах, с автоматичеcкой регистрацией в БД")); QVBoxLayout *verticalLayout = new QVBoxLayout(); verticalLayout->addStretch(0); verticalLayout->addWidget(topLabel); verticalLayout->addSpacing(3); verticalLayout->addWidget(printersCBox); verticalLayout->addWidget(markBrakDoc); verticalLayout->addWidget(accountingDoc); verticalLayout->addWidget(printDoc); verticalLayout->addWidget(both_step); verticalLayout->addStretch(0); setLayout(verticalLayout); connect (printersCBox,SIGNAL(currentIndexChanged(int)), this, SLOT(selectedPrinter(int)) ); }
ConfigDialog::ConfigDialog(QVector<Station*> *pStationList, QVector<Satellite*> *pSatelliteList, QWidget* parent) { Q_UNUSED(parent); pContentsWidget = new QListWidget; pContentsWidget->setViewMode(QListView::IconMode); pContentsWidget->setIconSize(QSize(96, 84)); pContentsWidget->setMovement(QListView::Static); pContentsWidget->setMaximumWidth(128); pContentsWidget->setSpacing(12); pContentsWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); pPagesWidget = new QStackedWidget; pPagesWidget->addWidget(new CommonSettings()); pPagesWidget->addWidget(new SatelliteSettings(pSatelliteList)); pPagesWidget->addWidget(new StationSettings(pStationList, pSatelliteList)); pPagesWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QPushButton *closeButton = new QPushButton(tr("Apply and close")); createIcons(); pContentsWidget->setCurrentRow(0); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QHBoxLayout *horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget(pContentsWidget); horizontalLayout->addWidget(pPagesWidget, 1); QHBoxLayout *buttonsLayout = new QHBoxLayout; //buttonsLayout->addStretch(1); buttonsLayout->addWidget(closeButton); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(horizontalLayout); //mainLayout->addStretch(1); mainLayout->addSpacing(12); mainLayout->addLayout(buttonsLayout); setLayout(mainLayout); setWindowTitle(tr("Config Dialog")); resize(600,400); }
void TransmitOptionsWidget::createPTTOptionsGroup() { QHBoxLayout *hbox1 = new QHBoxLayout(); hbox1->setSpacing(4); hbox1->addStretch(); //hbox1->addWidget(penelopeBtn); //hbox1->addWidget(mercuryBtn); QVBoxLayout *vbox = new QVBoxLayout(); vbox->setSpacing(4); vbox->addSpacing(6); vbox->addLayout(hbox1); pttOptionsGroup = new QGroupBox(tr("PTT Options"), this); pttOptionsGroup->setMinimumWidth(m_minimumGroupBoxWidth); pttOptionsGroup->setLayout(vbox); pttOptionsGroup->setStyleSheet(set->getWidgetStyle()); pttOptionsGroup->setFont(QFont("Arial", 8)); }
void NavigationWidget::initUI() { m_toggleModeBtn->setAccessibleName("mode-toggle-button"); m_toggleModeBtn->setNormalPic(":/icons/skin/icons/category_normal_22px.svg"); m_toggleModeBtn->setHoverPic(":/icons/skin/icons/category_hover_22px.svg"); m_toggleModeBtn->setPressPic(":/icons/skin/icons/category_active_22px.svg"); m_toggleModeBtn->setStyleSheet("margin:0 0 0 20px;"); m_categoryGroup->addButton(m_internetBtn); m_categoryGroup->addButton(m_chatBtn); m_categoryGroup->addButton(m_musicBtn); m_categoryGroup->addButton(m_videoBtn); m_categoryGroup->addButton(m_graphicsBtn); m_categoryGroup->addButton(m_gameBtn); m_categoryGroup->addButton(m_officeBtn); m_categoryGroup->addButton(m_readingBtn); m_categoryGroup->addButton(m_developmentBtn); m_categoryGroup->addButton(m_systemBtn); m_categoryGroup->addButton(m_othersBtn); m_internetBtn->setChecked(true); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addSpacing(30); mainLayout->addWidget(m_toggleModeBtn); mainLayout->addStretch(); mainLayout->addWidget(m_internetBtn); mainLayout->addWidget(m_chatBtn); mainLayout->addWidget(m_musicBtn); mainLayout->addWidget(m_videoBtn); mainLayout->addWidget(m_graphicsBtn); mainLayout->addWidget(m_gameBtn); mainLayout->addWidget(m_officeBtn); mainLayout->addWidget(m_readingBtn); mainLayout->addWidget(m_developmentBtn); mainLayout->addWidget(m_systemBtn); mainLayout->addWidget(m_othersBtn); mainLayout->addStretch(); mainLayout->setSpacing(0); mainLayout->setMargin(0); setLayout(mainLayout); }
About::About(QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f) { // stuff setWindowTitle("About LibreLibreCell"); QLabel *versionLabel = new QLabel(QString("Git revision: %1").arg(LIBRELIBRECELL_VERSION)); QPlainTextEdit *aboutBox = new QPlainTextEdit; QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); QVBoxLayout *vLayout = new QVBoxLayout; vLayout->addWidget(versionLabel); vLayout->addWidget(aboutBox, 1); vLayout->addSpacing(10); vLayout->addWidget(buttonBox); setLayout(vLayout); aboutBox->setReadOnly(true); aboutBox->setTabChangesFocus(true); aboutBox->setWordWrapMode(QTextOption::NoWrap); aboutBox->setLineWrapMode(QPlainTextEdit::NoWrap); aboutBox->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); aboutBox->setFont(QFont("Monospace", 10)); QFile readme(":/README.txt"); if (readme.open(QIODevice::ReadOnly)) { QTextStream stream(&readme); aboutBox->setPlainText(stream.readAll()); readme.close(); } else { aboutBox->setPlainText("Could not open README.txt."); } QFontMetrics fm(aboutBox->font()); aboutBox->setMinimumSize(fm.width(QLatin1Char('m')) * 76, 450); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); }
QueryPage:: QueryPage(QWidget *parent) : QWidget(parent) { QGroupBox *packagesGroup = new QGroupBox("Look for packages"); QLabel *nameLabel = new QLabel("Name:"); QLineEdit *nameLineEdit = new QLineEdit; QLabel *dateLabel = new QLabel("Released after:"); QDateTimeEdit *dateEdit = new QDateTimeEdit(QDate::currentDate()); QCheckBox *releaseCheckBox = new QCheckBox("Releases"); QCheckBox *upgradesCheckBox = new QCheckBox("Upgrades"); QSpinBox *hitsSpinBox = new QSpinBox; hitsSpinBox->setPrefix("Return up to"); hitsSpinBox->setSuffix(" results"); hitsSpinBox->setSpecialValueText("Return only the first result"); hitsSpinBox->setMinimum(1); hitsSpinBox->setMaximum(100); hitsSpinBox->setSingleStep(10); QPushButton *startQueryButton = new QPushButton("Start query"); QGridLayout *packagesLayout = new QGridLayout; packagesLayout->addWidget(nameLabel, 0, 0); packagesLayout->addWidget(nameLineEdit, 0, 1); packagesLayout->addWidget(dateLabel, 1, 0); packagesLayout->addWidget(dateEdit, 1, 1); packagesLayout->addWidget(releaseCheckBox, 2, 0); packagesLayout->addWidget(upgradesCheckBox, 3, 0); packagesLayout->addWidget(hitsSpinBox, 4, 0, 1, 2); packagesGroup->setLayout(packagesLayout); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(packagesGroup); mainLayout->addSpacing(12); mainLayout->addWidget(startQueryButton); mainLayout->addStretch(1); setLayout(mainLayout); }
ResourceSelectDialog::ResourceSelectDialog(AddressBook *ab, QWidget *parent, const char *name) : KDialog(parent, name, true) { setCaption(i18n("Resource Selection")); resize(300, 200); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setMargin(marginHint()); QGroupBox *groupBox = new QGroupBox(2, Qt::Horizontal, this); groupBox->setTitle(i18n("Resources")); mResourceId = new KListBox(groupBox); mainLayout->addWidget(groupBox); mainLayout->addSpacing(10); KButtonBox *buttonBox = new KButtonBox(this); buttonBox->addStretch(); buttonBox->addButton(KStdGuiItem::ok(), this, SLOT(accept())); buttonBox->addButton(KStdGuiItem::cancel(), this, SLOT(reject())); buttonBox->layout(); mainLayout->addWidget(buttonBox); // setup listbox uint counter = 0; QPtrList< Resource > list = ab->resources(); for(uint i = 0; i < list.count(); ++i) { Resource *resource = list.at(i); if(resource && !resource->readOnly()) { mResourceMap.insert(counter, resource); mResourceId->insertItem(resource->resourceName()); counter++; } } mResourceId->setCurrentItem(0); }
void SetInsteonLevelDlg::layoutWindow(int deviceID, QString name, int level) { QVBoxLayout *vLayout = new QVBoxLayout(); QFormLayout *formLayout = new QFormLayout(); formLayout->addRow("Device ID", new QLabel(InsteonDevice::deviceIDToString(deviceID))); formLayout->addRow("Name", new QLabel(name)); QHBoxLayout *levelBox = new QHBoxLayout(); m_on = new QPushButton("On"); m_off = new QPushButton("Off"); m_level = new QSlider(Qt::Horizontal); m_level->setRange(0, 255); m_level->setTickInterval(15); m_level->setTickPosition(QSlider::TicksBelow); if ((level >= 0) && (level <= 255)) m_level->setValue(level); else m_level->setValue(0); m_level->setMinimumWidth(200); levelBox->addWidget(m_off); levelBox->addWidget(m_level); levelBox->addWidget(m_on); formLayout->addRow("Level", levelBox); vLayout->addLayout(formLayout); QHBoxLayout *hLayout = new QHBoxLayout(); m_okButton = new QPushButton("OK"); m_cancelButton = new QPushButton("Cancel"); hLayout->addStretch(); hLayout->addWidget(m_okButton); hLayout->addWidget(m_cancelButton); vLayout->addSpacing(20); vLayout->addLayout(hLayout); setLayout(vLayout); };
KileAbbrevInputDialog::KileAbbrevInputDialog(KileAbbrevView *listview, KListViewItem *item, int mode, const char *name ) : KDialogBase(listview,name, true, i18n("Add Abbreviation"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true), m_listview(listview), m_abbrevItem(item), m_mode(mode) { QWidget *page = new QWidget(this); setMainWidget(page); QVBoxLayout *vl = new QVBoxLayout(page, 0, spacingHint()); if ( m_mode == KileAbbrevView::ALVedit ) { setCaption( i18n("Edit Abbreviation") ); m_abbrev = m_abbrevItem->text(KileAbbrevView::ALVabbrev); m_expansion = m_abbrevItem->text(KileAbbrevView::ALVexpansion); } QLabel *abbrev = new QLabel(i18n("&Abbreviation:"),page); QLabel *expansion = new QLabel(i18n("&Expanded Text:"),page); m_leAbbrev = new KLineEdit(m_abbrev,page); m_leExpansion = new KLineEdit(m_expansion,page); vl->addWidget(abbrev); vl->addWidget(m_leAbbrev); vl->addWidget(expansion); vl->addWidget(m_leExpansion); vl->addSpacing(8); abbrev->setBuddy(m_leAbbrev); expansion->setBuddy(m_leExpansion); QRegExp reg("[a-zA-Z0-9]+"); QRegExpValidator *abbrevValidator = new QRegExpValidator(reg,this); m_leAbbrev->setValidator(abbrevValidator); connect(m_leAbbrev,SIGNAL(textChanged(const QString &)), this,SLOT(slotTextChanged(const QString &))); connect(m_leExpansion,SIGNAL(textChanged(const QString &)), this,SLOT(slotTextChanged(const QString &))); slotTextChanged(QString::null); m_leAbbrev->setFocus(); page->setMinimumWidth(350); }
DlgSettings::DlgSettings(QWidget *parent) : QDialog(parent) { connect(settingsCache, SIGNAL(langChanged()), this, SLOT(updateLanguage())); contentsWidget = new QListWidget; contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setIconSize(QSize(58, 50)); contentsWidget->setMovement(QListView::Static); contentsWidget->setMinimumHeight(85); contentsWidget->setMaximumHeight(85); contentsWidget->setSpacing(5); pagesWidget = new QStackedWidget; pagesWidget->addWidget(new GeneralSettingsPage); pagesWidget->addWidget(new AppearanceSettingsPage); pagesWidget->addWidget(new UserInterfaceSettingsPage); pagesWidget->addWidget(new DeckEditorSettingsPage); pagesWidget->addWidget(new MessagesSettingsPage); pagesWidget->addWidget(new SoundSettingsPage); pagesWidget->addWidget(new ShortcutsTab); createIcons(); contentsWidget->setCurrentRow(0); QVBoxLayout *vboxLayout = new QVBoxLayout; vboxLayout->addWidget(contentsWidget); vboxLayout->addWidget(pagesWidget); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); connect(buttonBox, SIGNAL(accepted()), this, SLOT(close())); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(vboxLayout); mainLayout->addSpacing(12); mainLayout->addWidget(buttonBox); setLayout(mainLayout); retranslateUi(); adjustSize(); }
void Window::newGame() { QDialog dialog(this); dialog.setWindowTitle(tr("New Game")); // Create options QComboBox* algorithms_box = new QComboBox(&dialog); algorithms_box->addItem(tr("Original"), 1); algorithms_box->addItem(tr("Branch"), 2); algorithms_box->addItem(tr("Line"), 3); algorithms_box->setCurrentIndex(algorithms_box->findData(m_algorithm)); QSpinBox* difficulty_box = new QSpinBox(&dialog); difficulty_box->setRange(1, 100); difficulty_box->setValue(m_difficulty); QSpinBox* seed_box = new QSpinBox(&dialog); seed_box->setRange(0, INT_MAX); seed_box->setValue(0); seed_box->setSpecialValueText(tr("Random")); // Create dialog buttons QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); // Lay out options QFormLayout* options_layout = new QFormLayout; options_layout->addRow(tr("Algorithm:"), algorithms_box); options_layout->addRow(tr("Difficulty:"), difficulty_box); options_layout->addRow(tr("Seed:"), seed_box); // Lay out dialog QVBoxLayout* layout = new QVBoxLayout(&dialog); layout->addLayout(options_layout); layout->addSpacing(18); layout->addWidget(buttons); if (dialog.exec() == QDialog::Accepted) { startGame(seed_box->value(), difficulty_box->value(), algorithms_box->itemData(algorithms_box->currentIndex()).toInt()); } }
Dialog::Dialog() { contentsWidget = new QListWidget; contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setIconSize(QSize(96, 84)); contentsWidget->setMovement(QListView::Static); contentsWidget->setMaximumWidth(128); contentsWidget->setSpacing(12); pagesWidget = new QStackedWidget; autoPipepage=new AutoPipePage; userPipepage=new UserPipePage; userFilterpage=new UserFilterPage; pagesWidget->addWidget(autoPipepage); pagesWidget->addWidget(userPipepage); pagesWidget->addWidget(userFilterpage); QPushButton *closeButton = new QPushButton(tr("Close")); createIcons(); contentsWidget->setCurrentRow(0); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QHBoxLayout *horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget(contentsWidget); horizontalLayout->addWidget(pagesWidget, 1); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(1); buttonsLayout->addWidget(closeButton); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(horizontalLayout); mainLayout->addStretch(1); mainLayout->addSpacing(12); mainLayout->addLayout(buttonsLayout); setLayout(mainLayout); this->move(1500,0);//move the dialog so that one can see the progress dialog setWindowTitle(tr("SuperPlugin Pipeline")); }
//create lattice dialog box constructor LatticeDialog::LatticeDialog() { QGroupBox *latticeGroup = new QGroupBox(tr("Lattice parameters")); QLabel *bondlLabel = new QLabel(tr("C-C bond length:")); bondlEdit = new QLineEdit; bondlEdit->setValidator(new QDoubleValidator(-999.0,999.0, 2, bondlEdit)); QLabel *xunitsLabel = new QLabel(tr("Unit cell repeat (x):")); xunitsEdit = new QLineEdit; xunitsEdit->setValidator(new QIntValidator(xunitsEdit)); QLabel *yunitsLabel = new QLabel(tr("Unit cell repeat (y):")); yunitsEdit = new QLineEdit; yunitsEdit->setValidator(new QIntValidator(yunitsEdit)); centerCheckBox = new QCheckBox(tr("Center coodinates")); createlatticeButton = new QPushButton(tr("Create lattice")); QGridLayout *latticeLayout = new QGridLayout; latticeLayout->addWidget(bondlLabel, 0, 0); latticeLayout->addWidget(bondlEdit, 0, 1); latticeLayout->addWidget(xunitsLabel, 1, 0); latticeLayout->addWidget(xunitsEdit, 1, 1); latticeLayout->addWidget(yunitsLabel, 2, 0); latticeLayout->addWidget(yunitsEdit, 2, 1); latticeLayout->addWidget(centerCheckBox, 3, 0); latticeGroup->setLayout(latticeLayout); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(latticeGroup); mainLayout->addSpacing(12); mainLayout->addWidget(createlatticeButton); mainLayout->addStretch(1); setLayout(mainLayout); connect(createlatticeButton, SIGNAL(clicked()), this, SLOT(latticeButtonPress())); setWindowTitle(tr("Create Lattice")); }
ValueDialog::ValueDialog(const char *caption, const char *msg, const char *ed_txt) : QDialog(kapp->mainWidget(), caption, TRUE) { setCaption(caption); QVBoxLayout *tl = new QVBoxLayout(this, 10, 10); QHBoxLayout *l1 = new QHBoxLayout; tl->addLayout(l1, 1); label = new QLabel(msg, this); label->setMinimumSize(label->sizeHint()); l1->addWidget(label); lined = new QLineEdit(this); lined->setMinimumWidth(lined->sizeHint().width()/2); lined->setFixedHeight(lined->sizeHint().height()); lined->setMaxLength(7); lined->setText(ed_txt); lined->selectAll(); lined->setFocus(); l1->addWidget(lined, 1); tl->addSpacing(10); KButtonBox *bbox = new KButtonBox(this); bbox->addStretch(1); ok = bbox->addButton(i18n("OK")); ok->setDefault(TRUE); connect(ok, SIGNAL(clicked()), SLOT(done_dialog())); cancel = bbox->addButton(i18n("Cancel")); connect(cancel, SIGNAL(clicked()), SLOT(reject())); bbox->layout(); tl->addWidget(bbox); connect(lined, SIGNAL(returnPressed()), SLOT(done_dialog())); QAccel *acc = new QAccel(this); acc->connectItem(acc->insertItem(Key_Escape), this, SLOT(reject())); tl->freeze(); }
ChatWidget::ChatWidget( QWidget * parent, const char * name ) : QWidget( parent, name ) { QVBoxLayout * layout = new QVBoxLayout( this ); _chat = new QMultiLineEdit( this ); _chat->setReadOnly( true ); layout->addWidget( _chat, 1 ); layout->addSpacing( 1 ); _edit = new QLineEdit( this ); _edit->setMinimumHeight( _edit->sizeHint().height() ); layout->addWidget( _edit ); layout->activate(); connect( _edit, SIGNAL( returnPressed() ), SLOT( slot_message() ) ); setMinimumHeight( 130 ); }
DeferAlarmDlg::DeferAlarmDlg(const QString &caption, const DateTime &initialDT, bool cancelButton, QWidget *parent, const char *name) : KDialogBase(parent, name, true, caption, Ok | Cancel | User1, Ok, false, i18n("Cancel &Deferral")) { if(!cancelButton) showButton(User1, false); QWidget *page = new QWidget(this); setMainWidget(page); QVBoxLayout *layout = new QVBoxLayout(page, 0, spacingHint()); mTimeWidget = new AlarmTimeWidget(AlarmTimeWidget::DEFER_TIME, page, "timeGroup"); mTimeWidget->setDateTime(initialDT); mTimeWidget->setMinDateTimeIsCurrent(); connect(mTimeWidget, SIGNAL(pastMax()), SLOT(slotPastLimit())); layout->addWidget(mTimeWidget); layout->addSpacing(spacingHint()); setButtonWhatsThis(Ok, i18n("Defer the alarm until the specified time.")); setButtonWhatsThis(User1, i18n("Cancel the deferred alarm. This does not affect future recurrences.")); }
EventView::EventView(FileSet * _fileSet, unsigned int _history, char const * _name) : Super(NULL, _name), fileSet_(_fileSet), list_(NULL), last_(NULL), internalSetSelection_(false), history_(_history) { setCaption("Event View"); QVBoxLayout * topBox = new QVBoxLayout(this, 0, -1, "boxLayout"); QVGroupBox * eventBox = new QVGroupBox(this, "eventBox"); list_ = new QListView(eventBox, "list"); list_->addColumn("Time Stamp"); list_->addColumn("Domain Name"); list_->addColumn("Type Name"); list_->addColumn("Event Name"); list_->setSorting(-1); list_->setAllColumnsShowFocus(true); topBox->addSpacing(10); topBox->addWidget(eventBox); eventBox->setTitle("Events"); // connect to file set events FileSet::FileVector::iterator first, last = fileSet_->fileVector().end(); for (first = fileSet_->fileVector().begin(); first != last; ++first) { connect(*first, SIGNAL(newEvent(const QString&,const QString&,const QString&,const QString&)), this, SLOT(insertEvent(const QString&,const QString&,const QString&,const QString&))); } connect(list_, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(selectionChanged(QListViewItem *))); fileSet_->getEvents(fileSet_->coursorTime(), history_); show(); }
PreferencesDialog::PreferencesDialog(QWidget* parent) : QDialog(parent) { pagesWidget_ = new QStackedWidget; pagesWidget_->addWidget(getGeneralPage()); pagesWidget_->addWidget(getCfgPage("microscope")); pagesWidget_->addWidget(getCfgPage("system")); pagesWidget_->addWidget(getCfgPage("software")); pagesWidget_->addWidget(getCfgPage("status")); pagesWidget_->addWidget(getCfgPage("viewer")); pagesWidget_->addWidget(getFontsPage()); pagesWidget_->setCurrentIndex(0); QPushButton *closeButton = new QPushButton(tr("Close")); connect(closeButton, &QAbstractButton::clicked, this, &QWidget::close); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->setMargin(10); buttonsLayout->addStretch(1); buttonsLayout->addWidget(closeButton); QFrame* hLine = new QFrame(this); hLine->setFrameStyle(QFrame::HLine | QFrame::Sunken); QVBoxLayout *verticalLayout = new QVBoxLayout; verticalLayout->setMargin(0); verticalLayout->setSpacing(0); verticalLayout->addStretch(0); verticalLayout->addWidget(setupToolBar(), 0); verticalLayout->addWidget(hLine, 0); verticalLayout->addWidget(pagesWidget_, 1); verticalLayout->addSpacing(12); verticalLayout->addLayout(buttonsLayout, 0); setLayout(verticalLayout); setWindowTitle(tr("Preferences")); setModal(true); resize(650, 600); }
Preferences::Preferences( QWidget* parent ) : QDialog(parent) { contentsWidget = new QListWidget; contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setIconSize(QSize(96, 84)); contentsWidget->setMovement(QListView::Static); contentsWidget->setMaximumWidth(128); contentsWidget->setSpacing(12); pagesWidget = new QStackedWidget; pagesWidget->addWidget(new GeneralPage(this)); pagesWidget->addWidget(new FilesPage(this)); pagesWidget->addWidget(new TimelinePage(this)); pagesWidget->addWidget(new ToolsPage(this)); pagesWidget->addWidget(new ShortcutsPage(this)); QPushButton* closeButton = new QPushButton(tr("Close")); createIcons(); contentsWidget->setCurrentRow(0); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QHBoxLayout* horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget(contentsWidget); horizontalLayout->addWidget(pagesWidget, 1); QHBoxLayout* buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(1); buttonsLayout->addWidget(closeButton); QVBoxLayout* mainLayout = new QVBoxLayout; mainLayout->addLayout(horizontalLayout); mainLayout->addStretch(1); mainLayout->addSpacing(12); mainLayout->addLayout(buttonsLayout); setLayout(mainLayout); setWindowTitle(tr("Preferences")); }
ScorePage::ScorePage(QWidget *parent) : QWidget(parent) { QGroupBox *packagesGroup = new QGroupBox(tr("Scoring function")); QLabel *ffLabel=new QLabel(tr("Force field:")); QComboBox *ffCombo=new QComboBox; // ffCombo->addItem( tr("Amber") ); // ffCombo->addItem( tr("Charmm") ); ffCombo->addItem( tr("Sybyl") ); QHBoxLayout *ffLayout=new QHBoxLayout; ffLayout->addWidget(ffLabel); ffLayout->addWidget(ffCombo); // QPushButton *startQueryButton = new QPushButton(tr("Set")); QGridLayout *packagesLayout = new QGridLayout; // packagesLayout->addLayout(ffLayout); packagesGroup->setLayout(packagesLayout); QPushButton *previousButton = new QPushButton(tr("Previous")); connect(previousButton, SIGNAL(clicked()), this, SLOT(sPrevious())); QPushButton *nextButton = new QPushButton(tr("Next")); connect(nextButton, SIGNAL(clicked()), this, SLOT(sNext())); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(1); buttonsLayout->addWidget(previousButton); buttonsLayout->addWidget(nextButton); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(packagesGroup); mainLayout->addLayout(ffLayout); mainLayout->addSpacing(12); // mainLayout->addWidget(startQueryButton); mainLayout->addStretch(12); mainLayout->addLayout(buttonsLayout); setLayout(mainLayout); }
UpdatePage:: UpdatePage(QWidget *parent) : QWidget(parent) { QGroupBox *updateGroup = new QGroupBox("Package seletion"); QCheckBox *systemCheckBox = new QCheckBox("Update system"); QCheckBox *appsCheckBox = new QCheckBox("Update applications"); QCheckBox *docsCheckBox = new QCheckBox("Update documentation"); QGroupBox *packageGroup = new QGroupBox("Existing packages"); QListWidget *packageList = new QListWidget; QListWidgetItem *qtItem = new QListWidgetItem(packageList); qtItem->setText(tr("Qt")); QListWidgetItem *qsaItem = new QListWidgetItem(packageList); qsaItem->setText(tr("QSA")); QListWidgetItem *teamBuilderItem = new QListWidgetItem(packageList); teamBuilderItem->setText(tr("TeamBuilder")); QPushButton *startUpdateButton = new QPushButton("Start update"); QVBoxLayout *updateLayout = new QVBoxLayout; updateLayout->addWidget(systemCheckBox); updateLayout->addWidget(appsCheckBox); updateLayout->addWidget(docsCheckBox); updateGroup->setLayout(updateLayout); QVBoxLayout *packageLayout = new QVBoxLayout; packageLayout->addWidget(packageList); packageGroup->setLayout(packageLayout); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(updateGroup); mainLayout->addWidget(packageGroup); mainLayout->addSpacing(12); mainLayout->addWidget(startUpdateButton); mainLayout->addStretch(1); setLayout(mainLayout); }
QWidget *RegularBattleScene::createFullBarLayout(int nslots, int player) { QLabel* oppPoke = new QLabel(); oppPoke->setPixmap(gui.theme->sprite("hpbar")); oppPoke->setFixedSize(oppPoke->pixmap()->size()); QVBoxLayout *oppl = new QVBoxLayout(oppPoke); oppl->setMargin(5); oppl->setSpacing(0); oppl->addSpacing(3); QHBoxLayout *oppl2 = new QHBoxLayout(); oppl->addLayout(oppl2); oppl2->setMargin(0); oppl2->setSpacing(6); for (int i = 0; i < nslots/2; i++) { oppl2->addLayout(createHPBarLayout(data()->spot(player, i))); } return oppPoke; }
ConfigDialog::ConfigDialog() { contentsWidget = new QListWidget; contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setIconSize(QSize(96, 84)); contentsWidget->setMovement(QListView::Static); contentsWidget->setMaximumWidth(128); contentsWidget->setSpacing(12); pagesWidget = new QStackedWidget; pagesWidget->addWidget(new ConfigurationPage); pagesWidget->addWidget(new UpdatePage); pagesWidget->addWidget(new QueryPage); QPushButton *closeButton = new QPushButton(tr("Close")); createIcons(); contentsWidget->setCurrentRow(0); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); connect(pagesWidget, SIGNAL(currentChanged(int)), this, SLOT(fadeInWidget(int))); QHBoxLayout *horizontalLayout = new QHBoxLayout; horizontalLayout->addWidget(contentsWidget); horizontalLayout->addWidget(pagesWidget, 1); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(1); buttonsLayout->addWidget(closeButton); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(horizontalLayout); mainLayout->addStretch(1); mainLayout->addSpacing(12); mainLayout->addLayout(buttonsLayout); setLayout(mainLayout); setWindowTitle(tr("Config Dialog")); }