QLayout * PageTraining::bodyLayoutDefinition() { QGridLayout * pageLayout = new QGridLayout(); // left column // declare start button, caption and description btnPreview = formattedButton(":/res/Trainings.png", true); // make both rows equal height pageLayout->setRowStretch(0, 1); pageLayout->setRowStretch(1, 1); // add start button, caption and description to 3 different rows pageLayout->addWidget(btnPreview, 0, 0); // center preview pageLayout->setAlignment(btnPreview, Qt::AlignRight | Qt::AlignVCenter); // right column // info area (caption on top, description below) QVBoxLayout * infoLayout = new QVBoxLayout(); lblCaption = new QLabel(); lblCaption->setMinimumWidth(360); lblCaption->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); lblCaption->setWordWrap(true); lblDescription = new QLabel(); lblDescription->setMinimumWidth(360); lblDescription->setAlignment(Qt::AlignHCenter | Qt::AlignTop); lblDescription->setWordWrap(true); infoLayout->addWidget(lblCaption); infoLayout->addWidget(lblDescription); pageLayout->addLayout(infoLayout, 0, 1); pageLayout->setAlignment(infoLayout, Qt::AlignLeft); // mission list lstMissions = new QListWidget(this); lstMissions->setWhatsThis(tr("Pick the mission or training to play")); pageLayout->addWidget(lstMissions, 1, 0, 1, 2); // span 2 columns // let's not make the list use more space than needed lstMissions->setFixedWidth(400); pageLayout->setAlignment(lstMissions, Qt::AlignHCenter); return pageLayout; }
TreeSearchFilters::TreeSearchFilters(QWidget *pParent) : QWidget(pParent) { // create the search text box mpSearchTextBox = new QLineEdit; // show hide button mpShowHideButton = new QToolButton; QString text = tr("Show/hide filters"); mpShowHideButton->setText(text); mpShowHideButton->setIcon(QIcon(":/Resources/icons/down.svg")); mpShowHideButton->setToolTip(text); mpShowHideButton->setAutoRaise(true); mpShowHideButton->setCheckable(true); connect(mpShowHideButton, SIGNAL(toggled(bool)), SLOT(showHideFilters(bool))); // filters widget mpFiltersWidget = new QWidget; // create the case sensitivity checkbox mpCaseSensitiveCheckBox = new QCheckBox(tr("Case Sensitive")); // create the search syntax combobox mpSyntaxComboBox = new QComboBox; mpSyntaxComboBox->addItem(tr("Regular Expression"), QRegExp::RegExp); mpSyntaxComboBox->setItemData(0, tr("A rich Perl-like pattern matching syntax."), Qt::ToolTipRole); mpSyntaxComboBox->addItem(tr("Wildcard"), QRegExp::Wildcard); mpSyntaxComboBox->setItemData(1, tr("A simple pattern matching syntax similar to that used by shells (command interpreters) for \"file globbing\"."), Qt::ToolTipRole); mpSyntaxComboBox->addItem(tr("Fixed String"), QRegExp::FixedString); mpSyntaxComboBox->setItemData(2, tr("Fixed string matching."), Qt::ToolTipRole); // expand all button mpExpandAllButton = new QPushButton(Helper::expandAll); mpExpandAllButton->setAutoDefault(false); // collapse all button mpCollapseAllButton = new QPushButton(Helper::collapseAll); mpCollapseAllButton->setAutoDefault(false); // create the layout QGridLayout *pFiltersWidgetLayout = new QGridLayout; pFiltersWidgetLayout->setContentsMargins(0, 0, 0, 0); pFiltersWidgetLayout->setAlignment(Qt::AlignTop); pFiltersWidgetLayout->addWidget(mpCaseSensitiveCheckBox, 0, 0); pFiltersWidgetLayout->addWidget(mpSyntaxComboBox, 0, 1); pFiltersWidgetLayout->addWidget(mpExpandAllButton, 1, 0); pFiltersWidgetLayout->addWidget(mpCollapseAllButton, 1, 1); mpFiltersWidget->setLayout(pFiltersWidgetLayout); mpFiltersWidget->hide(); // create the layout QGridLayout *pMainLayout = new QGridLayout; pMainLayout->setContentsMargins(0, 0, 0, 0); pMainLayout->setAlignment(Qt::AlignTop); pMainLayout->addWidget(mpSearchTextBox, 0, 0); pMainLayout->addWidget(mpShowHideButton, 0, 1); pMainLayout->addWidget(mpFiltersWidget, 1, 0, 1, 2); setLayout(pMainLayout); }
void ParametersFrame::load(RichParameterSet* parameters){ /// Stores parameters so we can later update them this->parameters = parameters; /// Schedule old ones for deletion { foreach(QWidget* widget, widgets) widget->deleteLater(); widgets.clear(); } /// @todo is this necessary or we can just do it in the constructor? { if(layout()) delete layout(); QGridLayout * vLayout = new QGridLayout(this); vLayout->setAlignment(Qt::AlignTop); } /// Create widgets and insert them in the layout for(int i = 0; i < parameters->paramList.count(); i++) { RichParameter* fpi=parameters->paramList.at(i); RichParameterWidget* widget = fpi->getWidget(this); widgets.push_back(widget); } /// Once done filling, show form this->showNormal(); // this->adjustSize(); unnecessary }
SpritePropertyWidget::SpritePropertyWidget(EditorWidget *editor) { this->editor = editor; QGridLayout* layout = new QGridLayout(this); layout->setAlignment(Qt::AlignTop); QLabel* xLabel = new QLabel(QString("X:")); QLabel* yLabel = new QLabel(QString("Y:")); QLabel* wLabel = new QLabel(QString("Width:")); QLabel* hLabel = new QLabel(QString("Height:")); QLabel* parameterLabel = new QLabel(QString("Parameter:")); xBox = Tools::NewSpinBox(INT_MIN); yBox = Tools::NewSpinBox(INT_MIN); wBox = Tools::NewSpinBox(INT_MIN); hBox = Tools::NewSpinBox(INT_MIN); parameterBox = Tools::NewSpinBox(INT_MIN); layout->addWidget(xLabel,0,0); layout->addWidget(xBox,0,1); layout->addWidget(yLabel,1,0); layout->addWidget(yBox,1,1); layout->addWidget(parameterLabel,2,0); layout->addWidget(parameterBox,2,1); layout->addWidget(wLabel,3,0); layout->addWidget(wBox,3,1); layout->addWidget(hLabel,4,0); layout->addWidget(hBox,4,1); connect(xBox,SIGNAL(valueChanged(int)),this,SLOT(UpdateSelectedSprite())); connect(yBox,SIGNAL(valueChanged(int)),this,SLOT(UpdateSelectedSprite())); connect(parameterBox,SIGNAL(valueChanged(int)),this,SLOT(UpdateSelectedSprite())); connect(wBox,SIGNAL(valueChanged(int)),this,SLOT(UpdateSelectedSprite())); connect(hBox,SIGNAL(valueChanged(int)),this,SLOT(UpdateSelectedSprite())); }
ConnectionBasicTab::ConnectionBasicTab(ConnectionSettings *settings) : _settings(settings) { QLabel *connectionDescriptionLabel = new QLabel( "Choose any connection name that will help you to identify this connection."); connectionDescriptionLabel->setWordWrap(true); connectionDescriptionLabel->setContentsMargins(0, -2, 0, 20); QLabel *serverDescriptionLabel = new QLabel( "Specify host and port of MongoDB server. Host can be either IP or domain name."); serverDescriptionLabel->setWordWrap(true); serverDescriptionLabel->setContentsMargins(0, -2, 0, 20); _connectionName = new QLineEdit(_settings->connectionName()); _serverAddress = new QLineEdit(_settings->serverHost()); _serverPort = new QLineEdit(QString::number(_settings->serverPort())); _serverPort->setFixedWidth(80); QGridLayout *connectionLayout = new QGridLayout; connectionLayout->addWidget(new QLabel("Name:"), 1, 0); connectionLayout->addWidget(_connectionName, 1, 1, 1, 3); connectionLayout->addWidget(connectionDescriptionLabel, 2, 1, 1, 3); connectionLayout->addWidget(serverDescriptionLabel, 4, 1, 1, 3); connectionLayout->addWidget(new QLabel("Address:"), 3, 0); connectionLayout->addWidget(_serverAddress, 3, 1); connectionLayout->addWidget(new QLabel(":"), 3, 2); connectionLayout->addWidget(_serverPort, 3, 3); connectionLayout->setAlignment(Qt::AlignTop); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(connectionLayout); setLayout(mainLayout); _connectionName->setFocus(); }
DistName::DistName(QWidget* parent) : QWidget(parent) { DistNameLayout = new QGridLayout(); DistNameLayout->setAlignment(Qt::AlignTop); DistNameLayout->setSpacing(6); DistNameLayout->setMargin(11); QGridLayout *g = new QGridLayout(); g->setAlignment(Qt::AlignTop); g->setSpacing(6); g->setMargin(11); QVBoxLayout *v = new QVBoxLayout(this); v->setSpacing(6); v->setMargin(11); v->addLayout(DistNameLayout); v->addStretch(); v->addLayout(g); rfc2253 = new QLineEdit(this); rfc2253->setReadOnly(true); g->addWidget(new QLabel(QString("RFC 2253:"), this), 0, 0); g->addWidget(rfc2253, 0, 1); namehash = new QLineEdit(this); namehash->setReadOnly(true); g->addWidget(new QLabel(QString("Hash:"), this), 1, 0); g->addWidget(namehash, 1, 1); }
QWidget *dSettingLocalUser::createWidget() { QWidget * widget = new QWidget(); QVBoxLayout *layout_main = new QVBoxLayout; QGridLayout *layout = new QGridLayout(); layout->setAlignment(Qt::AlignRight); layout->addWidget ( new QLabel(tr("Имя:")), 1, 0 ,Qt::AlignRight); layout->addWidget ( new QLabel(tr("Авто-ответ:")), 2, 0,Qt::AlignTop ); layout->addWidget ( new QLabel(tr("Логин:")), 3, 0 ,Qt::AlignRight); layout->addWidget ( new QLabel(tr("Пол:")), 4, 0 ,Qt::AlignRight); // layout->addWidget ( new QLabel("Аватар:"), 3, 0 ); nameLineEdit = new QLineEdit(user->get_name()); connect(nameLineEdit, SIGNAL(editingFinished()), this, SLOT(nameEdited())); layout->addWidget ( nameLineEdit, 1, 1 ); auto_answerEdit = new QTextEdit(); auto_answerEdit->setPlainText(user->get_auto_answer()); connect(auto_answerEdit, SIGNAL(textChanged()), this, SLOT(autoAnswerChanged())); layout->addWidget ( auto_answerEdit, 2, 1 ); loginLineEdit = new QLineEdit(user->get_login()); connect(loginLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(loginEdited(const QString&))); layout->addWidget ( loginLineEdit, 3, 1 ); QHBoxLayout *sexLayout = new QHBoxLayout; sexLayout->setSpacing(15); sexComboBox = new QComboBox; sexComboBox->addItem(tr("Безполый")); sexComboBox->addItem(tr("Женский")); sexComboBox->addItem(tr("Мужской")); sexComboBox->setCurrentIndex(user->get_sex()); connect(sexComboBox, SIGNAL(activated (int)), this, SLOT(sexActivated (int))); sexLayout->addWidget (sexComboBox ); sexLayout->addStretch ( 1 ); layout->addLayout( sexLayout, 4, 1 ); avatarPushButton = new QPushButton(tr("Изменить аватар")); avatarPushButton->setDefault(true); avatarPushButton->setIcon(QIcon(tr("pic/open32x32.png"))); connect(avatarPushButton, SIGNAL(clicked(bool)), this, SLOT(clickedAvatarButton(bool))); layout->addWidget ( avatarPushButton, 0, 1 ); avatarLabel = new QLabel(); QPixmap avatar = user->get_avatar(); avatar.scaled(48,48); avatarLabel->setPixmap(avatar); layout->addWidget ( avatarLabel , 0, 0 ); layout_main->addLayout( layout ); QCheckBox *passiveModeCheckBox = new QCheckBox(tr("Пассивный режим")); passiveModeCheckBox->setChecked(toInt(tr("passive_mode"),tr("value"),0)); connect(passiveModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(passiveModeChanged(int))); layout_main->addWidget ( passiveModeCheckBox ); layout_main->addWidget ( new QLabel(tr("При использовании пассивного режима пользователя не видят в других чатах!")) ); widget->setLayout(layout_main); return widget; };
/*" + gaycolor.red() + "," + gaycolor.green() + "," + gaycolor.blue() + "*/ PluginGeneratorGUI::PluginGeneratorGUI(PluginManager& pman,QWidget* parent ) :QDockWidget(parent),plugscriptname(),author(),mail(),init(false),finfo(QApplication::applicationDirPath()),doc(NULL),PM(pman) { QFrame* f = new QFrame(this); QGridLayout* lay = new QGridLayout(); tabs = new QTabWidget(this); tabs->setUsesScrollButtons(true); //setWidget(tabs); int openedtabs = tabs->count(); if (openedtabs == 0) addNewFilter(); else { if (openedtabs > 1) for (int ii = 1;ii < openedtabs;++ii) tabs->removeTab(ii); addNewFilter(); } lay->addWidget(tabs); lay->setAlignment(Qt::AlignVCenter); f->setLayout(lay); setWidget(f); createContextMenu(); this->setVisible(false); //this->setScroll }
/*! * \param pParent */ AttachToProcessDialog::AttachToProcessDialog(QWidget *pParent) : QDialog(pParent) { setWindowTitle(QString(Helper::applicationName).append(" - ").append(Helper::attachToRunningProcess)); setAttribute(Qt::WA_DeleteOnClose); resize(500, 400); // attach to process id mpAttachToProcessIDLabel = new Label(tr("Attach to Process ID:")); mpAttachToProcessIDTextBox = new QLineEdit; // filter mpFilterProcessesTextBox = new QLineEdit; mpFilterProcessesTextBox->setPlaceholderText(tr("Filter Processes")); // processes tree view model & proxy mpProcessListModel = new ProcessListModel; mProcessListFilterModel.setSourceModel(mpProcessListModel); mProcessListFilterModel.setFilterRegExp(mpFilterProcessesTextBox->text()); // processes tree view mpProcessesTreeView = new QTreeView; mpProcessesTreeView->setItemDelegate(new ItemDelegate(mpProcessesTreeView)); mpProcessesTreeView->setModel(&mProcessListFilterModel); mpProcessesTreeView->setTextElideMode(Qt::ElideMiddle); mpProcessesTreeView->setIndentation(0); mpProcessesTreeView->setSelectionBehavior(QAbstractItemView::SelectRows); mpProcessesTreeView->setSelectionMode(QAbstractItemView::SingleSelection); mpProcessesTreeView->setUniformRowHeights(true); //mpProcessesTreeView->setRootIsDecorated(false); mpProcessesTreeView->setSortingEnabled(true); mpProcessesTreeView->header()->setDefaultSectionSize(100); mpProcessesTreeView->header()->setStretchLastSection(true); mpProcessesTreeView->sortByColumn(1, Qt::AscendingOrder); // Create the buttons mpOkButton = new QPushButton(Helper::ok); mpOkButton->setEnabled(false); connect(mpOkButton, SIGNAL(clicked()), SLOT(attachProcess())); mpRefreshButton = new QPushButton(Helper::refresh); connect(mpRefreshButton, SIGNAL(clicked()), SLOT(updateProcessList())); mpCancelButton = new QPushButton(Helper::cancel); connect(mpCancelButton, SIGNAL(clicked()), SLOT(reject())); // create buttons box mpButtonBox = new QDialogButtonBox(Qt::Horizontal); mpButtonBox->addButton(mpOkButton, QDialogButtonBox::ActionRole); mpButtonBox->addButton(mpRefreshButton, QDialogButtonBox::ActionRole); mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole); connect(mpAttachToProcessIDTextBox, SIGNAL(textChanged(QString)), this, SLOT(processIDChanged(QString))); connect(mpFilterProcessesTextBox, SIGNAL(textChanged(QString)), this, SLOT(setFilterString(QString))); connect(mpProcessesTreeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(processSelected(QModelIndex))); connect(mpProcessesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(processClicked(QModelIndex))); // set the layout QGridLayout *pMainLayout = new QGridLayout; pMainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); pMainLayout->addWidget(mpAttachToProcessIDLabel, 0, 0); pMainLayout->addWidget(mpAttachToProcessIDTextBox, 0, 1); pMainLayout->addWidget(mpFilterProcessesTextBox, 1, 0, 1 ,2); pMainLayout->addWidget(mpProcessesTreeView, 2, 0, 1 ,2); pMainLayout->addWidget(mpButtonBox, 3, 0, 1, 2, Qt::AlignRight); setLayout(pMainLayout); // get the list of processes updateProcessList(); }
QWidget* CreateCollectionDialog::createOptionsTab() { QWidget *optionsTab = new QWidget(this); _cappedCheckBox = new QCheckBox(tr("Create capped collection"), optionsTab); _sizeInputLabel = new QLabel(tr("Maximum size in bytes: ")); _sizeInputLabel->setContentsMargins(22, 0, 0, 0); _sizeInputEdit = new QLineEdit(); _sizeInputEdit->setEnabled(false); _maxDocNumberInputLabel = new QLabel(tr("Maximum number of documents: ")); _maxDocNumberInputLabel->setContentsMargins(22, 0, 0, 0); _maxDocNumberInputEdit = new QLineEdit(); _maxDocNumberInputEdit->setEnabled(false); _autoIndexCheckBox = new QCheckBox(tr("Auto index _id"), optionsTab); _autoIndexCheckBox->setChecked(true); _usePowerOfTwoSizeCheckBox = new QCheckBox(tr("Use power-of-2 sizes"), optionsTab); _noPaddingCheckBox = new QCheckBox(tr("No Padding"), optionsTab); VERIFY(connect(_cappedCheckBox, SIGNAL(stateChanged(int)), this, SLOT(onCappedCheckBoxChanged(int)))); QGridLayout *layout = new QGridLayout; layout->addWidget(_cappedCheckBox, 0, 0, 1, 2); layout->addWidget(_sizeInputLabel, 1, 0); layout->addWidget(_sizeInputEdit, 1, 1); layout->addWidget(_maxDocNumberInputLabel, 2, 0); layout->addWidget(_maxDocNumberInputEdit, 2, 1); layout->addWidget(_autoIndexCheckBox, 3, 0); layout->addWidget(_usePowerOfTwoSizeCheckBox, 4, 0); layout->addWidget(_noPaddingCheckBox, 5, 0); layout->setAlignment(Qt::AlignTop); optionsTab->setLayout(layout); return optionsTab; }
bool QGridLayoutProto::setAlignment(QLayout *l, Qt::Alignment alignment) { QGridLayout *item = qscriptvalue_cast<QGridLayout*>(thisObject()); if (item) return item->setAlignment(l, alignment); return false; }
/*! * \brief ImportFMUModelDescriptionDialog::ImportFMUModelDescriptionDialog * \param pParent */ ImportFMUModelDescriptionDialog::ImportFMUModelDescriptionDialog(QWidget *pParent) : QDialog(pParent) { setWindowTitle(QString(Helper::applicationName).append(" - ").append(tr("Import FMU Model Description"))); setAttribute(Qt::WA_DeleteOnClose); setMinimumWidth(550); // create FMU File selection controls mpFmuModelDescriptionLabel = new Label(tr("FMU Model Description:")); mpFmuModelDescriptionTextBox = new QLineEdit; mpBrowseFileButton = new QPushButton(Helper::browse); mpBrowseFileButton->setAutoDefault(false); connect(mpBrowseFileButton, SIGNAL(clicked()), SLOT(setSelectedFile())); // create Output Directory selection controls mpOutputDirectoryLabel = new Label(tr("Output Directory:")); mpOutputDirectoryTextBox = new QLineEdit; mpBrowseDirectoryButton = new QPushButton(Helper::browse); mpBrowseDirectoryButton->setAutoDefault(false); connect(mpBrowseDirectoryButton, SIGNAL(clicked()), SLOT(setSelectedDirectory())); // create OK button mpImportButton = new QPushButton(Helper::ok); mpImportButton->setAutoDefault(true); connect(mpImportButton, SIGNAL(clicked()), SLOT(importFMUModelDescription())); // set grid layout QGridLayout *pMainLayout = new QGridLayout; pMainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); pMainLayout->addWidget(mpFmuModelDescriptionLabel, 0, 0); pMainLayout->addWidget(mpFmuModelDescriptionTextBox, 0, 1); pMainLayout->addWidget(mpBrowseFileButton, 0, 2); pMainLayout->addWidget(mpOutputDirectoryLabel, 1, 0); pMainLayout->addWidget(mpOutputDirectoryTextBox, 1, 1); pMainLayout->addWidget(mpBrowseDirectoryButton, 1, 2); pMainLayout->addWidget(mpImportButton, 2, 0, 1, 3, Qt::AlignRight); setLayout(pMainLayout); }
void WiredDestination::createInterface() { QGridLayout *lay = new QGridLayout(this); lay->setAlignment(Qt::AlignTop); lay->setColumnStretch(1,1); setContentsMargins(3,3,3,3); // Top QLabel *icon = new QLabel(); icon->setPixmap(KIcon("network-workgroup").pixmap(32,32)); QLabel *type = new QLabel(i18n("Subnet")); lay->addWidget(icon,0,0, Qt::AlignLeft); lay->addWidget(type,0,1,Qt::AlignCenter); // Line Sep QFrame *sepLine = new QFrame(); sepLine->setFrameStyle( QFrame::HLine ); lay->addWidget(sepLine,1,0,1,2); // Bottom m_netmaskLabel = new QLabel(); m_netmaskLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); m_subnetLabel = new QLabel(); m_subnetLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); setNetmaskString(); setSubnetString(); lay->addWidget(m_subnetLabel,2,0,1,2, Qt::AlignTop); lay->addWidget(m_netmaskLabel,3,0,1,2, Qt::AlignTop); }
ImageBounds::ImageBounds(QWidget *parent) : QWidget(parent) { QGridLayout *layout = new QGridLayout(); layout->setSizeConstraint(QLayout::SetFixedSize); ///Todo: make this align top layout->setAlignment(Qt::AlignTop); setLayout(layout); btnAlpha = new QPushButton("Alpha", this); layout->addWidget(btnAlpha, 0,1); layout->addWidget(new QLabel("Rows: ", this, 0),1,0); layout->addWidget(new QLabel("Columns: ", this, 0),2,0); layout->addWidget(new QLabel("X Seperation: ", this, 0),3,0); layout->addWidget(new QLabel("Y Seperation: ", this, 0),4,0); spnRows = new QSpinBox(this); spnRows->setValue(1); spnColumns = new QSpinBox(this); spnColumns->setValue(1); spnXsep = new QSpinBox(this); spnYsep = new QSpinBox(this); layout->addWidget(spnRows,1,1); layout->addWidget(spnColumns,2,1); layout->addWidget(spnXsep,3,1); layout->addWidget(spnYsep,4,1); btnImport = new QPushButton("Import", this); layout->addWidget(btnImport, 5,0); layout->addWidget(new QPushButton("Cancel", this), 5,1); }
SelectionPage::SelectionPage( QWidget* parent, const char* name ) : QWidget( parent ) { setObjectName( name ); setWindowTitle( i18n( "Choose Which Contacts to Print" ) ); QVBoxLayout *topLayout = new QVBoxLayout( this ); topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( KDialog::marginHint() ); QLabel *label = new QLabel( i18n( "Which contacts do you want to print?" ), this ); topLayout->addWidget( label ); mButtonGroup = new QGroupBox( this ); //mButtonGroup->setFrameShape( QFrame::NoFrame ); // mButtonGroup->setColumnLayout( 0, Qt::Vertical ); QGridLayout *groupLayout = new QGridLayout(); mButtonGroup->setLayout( groupLayout ); mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); mButtonGroup->layout()->setMargin( KDialog::marginHint() ); groupLayout->setAlignment( Qt::AlignTop ); mUseWholeBook = new QRadioButton( i18n( "&All contacts" ), mButtonGroup ); mUseWholeBook->setChecked( true ); mUseWholeBook->setWhatsThis( i18n( "Print the entire address book" ) ); groupLayout->addWidget( mUseWholeBook, 0, 0 ); mUseSelection = new QRadioButton( i18n( "&Selected contacts" ), mButtonGroup ); mUseSelection->setWhatsThis( i18n( "Only print contacts selected in KAddressBook.\n" "This option is disabled if no contacts are selected." ) ); groupLayout->addWidget( mUseSelection, 1, 0 ); mUseFilters = new QRadioButton( i18n( "Contacts matching &filter" ), mButtonGroup ); mUseFilters->setWhatsThis( i18n( "Only print contacts matching the selected filter.\n" "This option is disabled if you have not defined any filters." ) ); groupLayout->addWidget( mUseFilters, 2, 0 ); mUseCategories = new QRadioButton( i18n( "Category &members" ), mButtonGroup ); mUseCategories->setWhatsThis( i18n( "Only print contacts who are members of a category that is checked on the list to the left.\n" "This option is disabled if you have no categories." ) ); groupLayout->addWidget( mUseCategories, 3, 0, Qt::AlignTop ); mFiltersCombo = new KComboBox( mButtonGroup ); mFiltersCombo->setEditable( false ); mFiltersCombo->setWhatsThis( i18n( "Select a filter to decide which contacts to print." ) ); groupLayout->addWidget( mFiltersCombo, 2, 1 ); mCategoriesView = new KPIM::CategorySelectWidget( mButtonGroup, KABPrefs::instance() ); mCategoriesView->hideButton(); mCategoriesView->layout()->setMargin( 0 ); mCategoriesView->setWhatsThis( i18n( "Check the categories whose members you want to print." ) ); groupLayout->addWidget( mCategoriesView, 3, 1 ); topLayout->addWidget( mButtonGroup ); connect( mFiltersCombo, SIGNAL( activated(int) ), SLOT( filterChanged() ) ); connect( mCategoriesView->listView(), SIGNAL( itemClicked( QTreeWidgetItem *, int ) ), SLOT( categoryChanged() ) ); }
QGridLayout* ProjectWindow::setupImageActions() { QGridLayout* layout = new QGridLayout; layout->setAlignment(Qt::AlignLeft); layout->setSpacing(5); layout->setMargin(0); QPushButton* reindexButton = new QPushButton(ApplicationData::icon("refresh"), "Re-index Images"); connect(reindexButton, &QPushButton::clicked, &projectData, &ProjectData::indexImages); layout->addWidget(reindexButton, 0, 0); QPushButton* resetImageConfigsButton = new QPushButton(ApplicationData::icon("reset"), "Reset Image Parameters"); connect(resetImageConfigsButton, &QPushButton::clicked, &projectData, &ProjectData::resetImageConfigs); layout->addWidget(resetImageConfigsButton, 0, 1); QPushButton* renumberButton = new QPushButton(ApplicationData::icon("renumber"), "Renumber Images"); connect(renumberButton, &QPushButton::clicked, &projectData, &ProjectData::renumberImages); layout->addWidget(renumberButton, 1, 0); QPushButton* evenOddButton = new QPushButton(ApplicationData::icon("odd"), "Assign Even/Odd"); connect(evenOddButton, &QPushButton::clicked, &projectData, &ProjectData::assignEvenOdd); layout->addWidget(evenOddButton, 1, 1); for (int i = 0; i < layout->columnCount(); ++i) layout->setColumnStretch(i, 0); return layout; }
LevelPropertiesWidget::LevelPropertiesWidget(EditorWidget *editorWidget) { this->editor = editorWidget; //Our Layout QGridLayout* layout = new QGridLayout(this); layout->setAlignment(Qt::AlignTop); //labels QLabel* widthLabel = new QLabel("Width"); QLabel* heightLabel = new QLabel("Height"); //Boxes widthBox = Tools::NewSpinBox(0); widthBox->selectAll(); heightBox = Tools::NewSpinBox(0); //Box Content widthBox->setValue(editor->data.levelWidth); heightBox->setValue(editor->data.levelHeight); //Layout layout->addWidget(widthLabel, 0, 0); layout->addWidget(heightLabel, 1, 0); layout->addWidget(widthBox, 0, 1); layout->addWidget(heightBox, 1, 1); }
/*! * \brief AlignInterfacesDialog::AlignInterfacesDialog * \param pModelWidget * \param pConnectionLineAnnotation */ AlignInterfacesDialog::AlignInterfacesDialog(ModelWidget *pModelWidget, LineAnnotation *pConnectionLineAnnotation) : QDialog(pModelWidget), mpModelWidget(pModelWidget) { setWindowTitle(QString("%1 - %2 - %3").arg(Helper::applicationName).arg(Helper::alignInterfaces) .arg(mpModelWidget->getLibraryTreeItem()->getName())); setAttribute(Qt::WA_DeleteOnClose); // set heading mpAlignInterfacesHeading = Utilities::getHeadingLabel(QString("%1 - %2").arg(Helper::alignInterfaces) .arg(mpModelWidget->getLibraryTreeItem()->getName())); // set separator line mpHorizontalLine = Utilities::getHeadingLine(); // list of interfaces QStringList interfaces; if (pConnectionLineAnnotation) { interfaces << pConnectionLineAnnotation->getStartComponentName() + " -> " + pConnectionLineAnnotation->getEndComponentName(); interfaces << pConnectionLineAnnotation->getEndComponentName() + " -> " + pConnectionLineAnnotation->getStartComponentName(); } else { MetaModelEditor *pMetaModelEditor = dynamic_cast<MetaModelEditor*>(pModelWidget->getEditor()); if (pMetaModelEditor) { QDomNodeList connections = pMetaModelEditor->getConnections(); for (int i = 0; i < connections.size(); i++) { QDomElement connection = connections.at(i).toElement(); interfaces << connection.attribute("From") + " -> " + connection.attribute("To"); interfaces << connection.attribute("To") + " -> " + connection.attribute("From"); } } } // interfaces list mpInterfaceListWidget = new QListWidget; mpInterfaceListWidget->setItemDelegate(new ItemDelegate(mpInterfaceListWidget)); mpInterfaceListWidget->setTextElideMode(Qt::ElideMiddle); mpInterfaceListWidget->setSelectionMode(QAbstractItemView::SingleSelection); mpInterfaceListWidget->addItems(interfaces); if (interfaces.size() > 0) { mpInterfaceListWidget->item(0)->setSelected(true); } // Create the buttons mpOkButton = new QPushButton(Helper::ok); mpOkButton->setAutoDefault(true); connect(mpOkButton, SIGNAL(clicked()), SLOT(alignInterfaces())); mpCancelButton = new QPushButton(Helper::cancel); mpCancelButton->setAutoDefault(false); connect(mpCancelButton, SIGNAL(clicked()), SLOT(reject())); // add buttons mpButtonBox = new QDialogButtonBox(Qt::Horizontal); mpButtonBox->addButton(mpOkButton, QDialogButtonBox::ActionRole); mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole); // Create a layout QGridLayout *pMainLayout = new QGridLayout; pMainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); pMainLayout->addWidget(mpAlignInterfacesHeading, 0, 0); pMainLayout->addWidget(mpHorizontalLine, 1, 0); pMainLayout->addWidget(new Label(tr("Interfaces")), 2, 0); pMainLayout->addWidget(mpInterfaceListWidget, 3, 0); pMainLayout->addWidget(mpButtonBox, 4, 0, Qt::AlignRight); setLayout(pMainLayout); }
QGridLayout * ActionDialog::createLayout(QGroupBox *groupBox) { QGridLayout *gridLayout = new QGridLayout(groupBox); gridLayout->setAlignment(Qt::AlignTop); gridLayout->setSpacing(5); return gridLayout; }
ConnectionBasicTab::ConnectionBasicTab(ConnectionSettings *settings) : _settings(settings) { QLabel *connectionDescriptionLabel = new QLabel( "Choose any connection name that will help you to identify this connection."); connectionDescriptionLabel->setWordWrap(true); connectionDescriptionLabel->setContentsMargins(0, -2, 0, 20); QLabel *serverDescriptionLabel = new QLabel( "Specify host and port of MongoDB server. Host can be either IP or domain name."); serverDescriptionLabel->setWordWrap(true); serverDescriptionLabel->setContentsMargins(0, -2, 0, 20); _connectionName = new QLineEdit(QtUtils::toQString(_settings->connectionName())); _serverAddress = new QLineEdit(QtUtils::toQString(_settings->serverHost())); _serverPort = new QLineEdit(QString::number(_settings->serverPort())); _serverPort->setFixedWidth(80); QRegExp rx("\\d+");//(0-65554) _serverPort->setValidator(new QRegExpValidator(rx, this)); _sslSupport = new QCheckBox("SSL support"); _sslSupport->setChecked(_settings->sslInfo()._sslSupport); _sslPEMKeyFile = new QLineEdit(QtUtils::toQString(_settings->sslInfo()._sslPEMKeyFile)); #ifdef Q_OS_WIN QRegExp pathx("([a-zA-Z]:)?([\\\\/][a-zA-Z0-9_.-]+)+[\\\\/]?"); #else QRegExp pathx("^\\/?([\\d\\w\\.]+)(/([\\d\\w\\.]+))*\\/?$"); #endif // Q_OS_WIN _sslPEMKeyFile->setValidator(new QRegExpValidator(pathx, this)); _selectFileB = new QPushButton("..."); _selectFileB->setFixedSize(20,20); VERIFY(connect(_selectFileB, SIGNAL(clicked()), this, SLOT(setSslPEMKeyFile()))); QGridLayout *connectionLayout = new QGridLayout; connectionLayout->addWidget(new QLabel("Name:"), 1, 0); connectionLayout->addWidget(_connectionName, 1, 1, 1, 3); connectionLayout->addWidget(connectionDescriptionLabel, 2, 1, 1, 3); connectionLayout->addWidget(serverDescriptionLabel, 4, 1, 1, 3); connectionLayout->addWidget(new QLabel("Address:"), 3, 0); connectionLayout->addWidget(_serverAddress, 3, 1); connectionLayout->addWidget(new QLabel(":"), 3, 2); connectionLayout->addWidget(_serverPort, 3, 3); connectionLayout->setAlignment(Qt::AlignTop); connectionLayout->addWidget(_sslSupport, 5, 1); connectionLayout->addWidget(_selectFileB, 5, 2); connectionLayout->addWidget(_sslPEMKeyFile, 5, 3); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(connectionLayout); setLayout(mainLayout); sslSupportStateChange(_sslSupport->checkState()); VERIFY(connect(_sslSupport,SIGNAL(stateChanged(int)),this,SLOT(sslSupportStateChange(int)))); _connectionName->setFocus(); }
void AppearanceSettings::initUi() { m_themeCombo = new QComboBox; m_themeCombo->setModel(new QStringListModel(this)); connect(m_themeCombo, SIGNAL(currentIndexChanged(int)), SLOT(themeChanged(int))); m_colorCombo = new QComboBox; m_colorCombo->setModel(new QStringListModel(this)); connect(m_colorCombo, SIGNAL(currentIndexChanged(int)), SLOT(colorChanged(int))); m_backgroundCombo = new QComboBox; m_backgroundCombo->setModel(new QStringListModel(this)); connect(m_backgroundCombo, SIGNAL(currentIndexChanged(int)), SLOT(backgroundChanged(int))); m_softKeyIconCheck = new QCheckBox(tr("Use icons for soft keys")); gConfig.beginGroup("ContextMenu"); int labelType = (QSoftMenuBar::LabelType)gConfig.value("LabelType", QSoftMenuBar::TextLabel).toInt(); gConfig.endGroup(); m_softKeyIconCheck->setChecked(labelType == QSoftMenuBar::IconLabel); connect(m_softKeyIconCheck, SIGNAL(clicked(bool)), SLOT(softKeyOptionChanged())); QFormLayout *form = new QFormLayout; form->addRow(tr("Theme"), m_themeCombo); form->addRow(tr("Color"), m_colorCombo); form->addRow(tr("Background"), m_backgroundCombo); form->addRow(m_softKeyIconCheck); form->setAlignment(m_softKeyIconCheck, Qt::AlignCenter); m_previewTitle = new QLabel; m_previewSoftMenuBar = new QLabel; m_previewBackground = new QLabel; QGridLayout *previewGrid = new QGridLayout; previewGrid->setMargin(10); previewGrid->setAlignment(Qt::AlignHCenter | Qt::AlignTop); previewGrid->addWidget(m_previewTitle, 0, 0); previewGrid->addWidget(m_previewSoftMenuBar, 1, 0); previewGrid->addWidget(m_previewBackground, 0, 1, 2, 1); m_previewBox = new QGroupBox; m_previewBox->setLayout(previewGrid); form->addRow(m_previewBox); m_previewBox->hide(); // hide until a preview is shown QScrollArea *scroll = new QScrollArea; scroll->setFocusPolicy(Qt::NoFocus); scroll->setFrameStyle(QFrame::NoFrame); QWidget *w = new QWidget; w->setLayout(form); scroll->setWidget(w); scroll->setWidgetResizable(true); scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->addWidget(scroll); setLayout(mainLayout); }
void UpsamplingParaDlg::setFrameConent() { if(layout()) delete layout(); QGridLayout * vLayout = new QGridLayout(this); vLayout->setAlignment(Qt::AlignTop); setLayout(vLayout); showNormal(); adjustSize(); }
DomainListView::DomainListView(KConfig *config,const QString &title, QWidget *parent,const char *name) : QGroupBox(title, parent, name), config(config) { setColumnLayout(0, Qt::Vertical); layout()->setSpacing(0); layout()->setMargin(0); QGridLayout* thisLayout = new QGridLayout(layout()); thisLayout->setAlignment(Qt::AlignTop); thisLayout->setSpacing(KDialog::spacingHint()); thisLayout->setMargin(KDialog::marginHint()); domainSpecificLV = new KListView(this); domainSpecificLV->addColumn(i18n("Host/Domain")); domainSpecificLV->addColumn(i18n("Policy"), 100); connect(domainSpecificLV,SIGNAL(doubleClicked(QListViewItem *)), SLOT(changePressed())); connect(domainSpecificLV,SIGNAL(returnPressed(QListViewItem *)), SLOT(changePressed())); connect(domainSpecificLV, SIGNAL( executed( QListViewItem *)), SLOT( updateButton())); connect(domainSpecificLV, SIGNAL(selectionChanged()), SLOT(updateButton())); thisLayout->addMultiCellWidget(domainSpecificLV, 0, 5, 0, 0); addDomainPB = new QPushButton(i18n("&New..."), this); thisLayout->addWidget(addDomainPB, 0, 1); connect(addDomainPB, SIGNAL(clicked()), SLOT(addPressed())); changeDomainPB = new QPushButton( i18n("Chan&ge..."), this); thisLayout->addWidget(changeDomainPB, 1, 1); connect(changeDomainPB, SIGNAL(clicked()), this, SLOT(changePressed())); deleteDomainPB = new QPushButton(i18n("De&lete"), this); thisLayout->addWidget(deleteDomainPB, 2, 1); connect(deleteDomainPB, SIGNAL(clicked()), this, SLOT(deletePressed())); importDomainPB = new QPushButton(i18n("&Import..."), this); thisLayout->addWidget(importDomainPB, 3, 1); connect(importDomainPB, SIGNAL(clicked()), this, SLOT(importPressed())); importDomainPB->setEnabled(false); importDomainPB->hide(); exportDomainPB = new QPushButton(i18n("&Export..."), this); thisLayout->addWidget(exportDomainPB, 4, 1); connect(exportDomainPB, SIGNAL(clicked()), this, SLOT(exportPressed())); exportDomainPB->setEnabled(false); exportDomainPB->hide(); QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); thisLayout->addItem(spacer, 5, 1); QWhatsThis::add( addDomainPB, i18n("Click on this button to manually add a host or domain " "specific policy.") ); QWhatsThis::add( changeDomainPB, i18n("Click on this button to change the policy for the " "host or domain selected in the list box.") ); QWhatsThis::add( deleteDomainPB, i18n("Click on this button to delete the policy for the " "host or domain selected in the list box.") ); updateButton(); }
QWidget* EditIndexDialog::createAdvancedTab() { QWidget *advanced = new QWidget(this); _sparceCheckBox = new QCheckBox(tr("Sparse"), advanced); _sparceCheckBox->setChecked(_info._sparse); _backGroundCheckBox = new QCheckBox(tr("Create index in background"), advanced); _backGroundCheckBox->setChecked(_info._backGround); QHBoxLayout *expireLayout = new QHBoxLayout; _expireAfterLineEdit = new QLineEdit(advanced); _expireAfterLineEdit->setMaximumWidth(150); QRegExp rx("\\d+"); _expireAfterLineEdit->setValidator(new QRegExpValidator(rx, this)); QLabel *secLabel = new QLabel(tr("seconds"), advanced); expireLayout->addWidget(_expireAfterLineEdit); expireLayout->addWidget(secLabel); expireLayout->addStretch(1); QCheckBox *expireCheckBox = new QCheckBox(tr("Expire after")); expireCheckBox->setChecked(false); if (_info._ttl >= 0) { expireCheckBox->setChecked(true); _expireAfterLineEdit->setText(QString("%1").arg(_info._ttl)); } expireStateChanged(expireCheckBox->checkState()); VERIFY(connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(expireStateChanged(int)))); QLabel *sparseHelpLabel = createHelpLabel( "If set, the index only references documents with the specified field. " "These indexes use less space but behave differently in some situations (particularly sorts).", 20, -2, 0, 20); QLabel *backgroundHelpLabel = createHelpLabel( "Builds the index in the background so that building an index does not block other database activities.", 20, -2, 0, 20); QLabel *expireHelpLabel = createHelpLabel( "Specifies a <i>time to live</i>, in seconds, to control how long MongoDB retains documents in this collection", 20, -2, 0, 20); QGridLayout *layout = new QGridLayout; layout->addWidget(_sparceCheckBox, 0, 0, 1, 2); layout->addWidget(sparseHelpLabel, 1, 0, 1, 2); layout->addWidget(_backGroundCheckBox, 2, 0, 1, 2); layout->addWidget(backgroundHelpLabel, 3, 0, 1, 2); layout->addWidget(expireCheckBox, 4, 0); layout->addLayout(expireLayout, 4, 1); layout->addWidget(expireHelpLabel, 5, 0, 1, 2); layout->setAlignment(Qt::AlignTop); advanced->setLayout(layout); return advanced; }
void NMEA_Anemometer::CreateGUI() { ui->setupUi(plugin_widget); ui->windAngleDial->setStyle(&winStyle); QGridLayout *aLayout = (QGridLayout*)ui->frame->layout(); aLayout->setAlignment(ui->windSpeedSlider, Qt::AlignCenter); connect(ui->windAngleDial, SIGNAL(valueChanged(int)), this, SLOT(on_windAngle_valueChanged())); connect(ui->windSpeedSlider, SIGNAL(valueChanged(int)), this, SLOT(on_windSpeed_valueChanged())); }
/*! * \brief MetaModelSimulationParamsDialog::MetaModelSimulationParamsDialog * \param pGraphicsView */ MetaModelSimulationParamsDialog::MetaModelSimulationParamsDialog(GraphicsView *pGraphicsView) : QDialog(pGraphicsView) { setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(QString("%1 - %2 - %3").arg(Helper::applicationName).arg(Helper::simulationParams) .arg(pGraphicsView->getModelWidget()->getLibraryTreeItem()->getName())); // set heading mpSimulationParamsHeading = Utilities::getHeadingLabel(QString("%1 - %2").arg(Helper::simulationParams) .arg(pGraphicsView->getModelWidget()->getLibraryTreeItem()->getName())); // set separator line mpHorizontalLine = Utilities::getHeadingLine(); mpGraphicsView = pGraphicsView; mpLibraryTreeItem = mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getCurrentModelWidget()->getLibraryTreeItem(); // Initialize simulation parameters mOldStartTime = ""; mOldStopTime = ""; MetaModelEditor *pMetaModelEditor = dynamic_cast<MetaModelEditor*>(mpGraphicsView->getModelWidget()->getEditor()); if(pMetaModelEditor->isSimulationParams()){ mOldStartTime = pMetaModelEditor->getSimulationStartTime(); mOldStopTime = pMetaModelEditor->getSimulationStopTime(); } // CoSimulation Interval mpStartTimeLabel = new Label(tr("Start Time:")); mpStartTimeTextBox = new QLineEdit(mOldStartTime); mpStopTimeLabel = new Label(tr("Stop Time:")); mpStopTimeTextBox = new QLineEdit(mOldStopTime); // Add the validators QDoubleValidator *pDoubleValidator = new QDoubleValidator(this); mpStartTimeTextBox->setValidator(pDoubleValidator); mpStopTimeTextBox->setValidator(pDoubleValidator); // buttons mpSaveButton = new QPushButton(Helper::save); mpSaveButton->setToolTip(tr("Saves the Co-Simulation experiment settings")); connect(mpSaveButton, SIGNAL(clicked()), this, SLOT(saveSimulationParams())); mpCancelButton = new QPushButton(Helper::cancel); connect(mpCancelButton, SIGNAL(clicked()), SLOT(reject())); // adds Co-Simulation Experiment Setting buttons to the button box mpButtonBox = new QDialogButtonBox(Qt::Horizontal); mpButtonBox->addButton(mpSaveButton, QDialogButtonBox::ActionRole); mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole); // set the layout QGridLayout *pMainLayout = new QGridLayout; pMainLayout->setAlignment(Qt::AlignLeft | Qt::AlignTop); pMainLayout->addWidget(mpSimulationParamsHeading, 0, 0, 1, 2); pMainLayout->addWidget(mpHorizontalLine, 1, 0, 1, 2); pMainLayout->addWidget(mpStartTimeLabel, 2, 0); pMainLayout->addWidget(mpStartTimeTextBox, 2, 1); pMainLayout->addWidget(mpStopTimeLabel, 3, 0); pMainLayout->addWidget(mpStopTimeTextBox, 3, 1); pMainLayout->addWidget(mpButtonBox, 4, 1, 1, 1, Qt::AlignRight); setLayout(pMainLayout); }
ToolWindow::ToolWindow(EmulatorWindow *window) : QFrame(window), emulator_window(window) { Q_INIT_RESOURCE(resources); setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); top_layout = new QBoxLayout(QBoxLayout::TopToBottom); top_layout->setContentsMargins(0, 0, 0, 0); setLayout(top_layout); setStyleSheet(QString("* { background: #2c3239 }")); title_bar = new TitleBarWidget(this); top_layout->addWidget(title_bar); QGridLayout *layout = new QGridLayout(); layout->setContentsMargins(10, 0, 10, 10); layout->setAlignment(Qt::AlignHCenter); int col = 0; int row = 0; addButton(layout, row++, col, ":/images/ic_power_settings_new_48px.svg", &EmulatorWindow::slot_power); addButton(layout, row++, col, ":/images/ic_volume_up_48px.svg", &EmulatorWindow::slot_volumeUp); addButton(layout, row++, col, ":/images/ic_volume_down_48px.svg", &EmulatorWindow::slot_volumeDown); addButton(layout, row++, col, ":/images/ic_stay_current_portrait_48px.svg", &EmulatorWindow::slot_rotate); addButton(layout, row++, col, ":/images/ic_zoom_in_24px.svg", &EmulatorWindow::slot_zoom); addButton(layout, row++, col, ":/images/ic_fullscreen_48px.svg", &EmulatorWindow::slot_fullscreen); expanded_buttons << addButton(layout, row++, col, ":/images/ic_camera_enhance_48px.svg", &EmulatorWindow::slot_screenshot); expanded_buttons << addButton(layout, row++, col, ":/images/ic_hangout_video_48px.svg", &EmulatorWindow::slot_screenrecord); expanded_buttons << addButton(layout, row++, col, ":/images/ic_arrow_back_48px.svg", &EmulatorWindow::slot_back); expanded_buttons << addButton(layout, row++, col, ":/images/ic_panorama_fish_eye_48px.svg", &EmulatorWindow::slot_home); expanded_buttons << addButton(layout, row++, col, ":/images/ic_crop_square_48px.svg", &EmulatorWindow::slot_recents); expanded_buttons << addButton(layout, row++, col, ":/images/ic_menu_48px.svg", &EmulatorWindow::slot_menu); col++; row = 0; expanded_buttons << addButton(layout, row++, col, ":/images/ic_mic_48px.svg", &EmulatorWindow::slot_voice); expanded_buttons << addButton(layout, row++, col, ":/images/ic_sd_card_48px.svg", &EmulatorWindow::slot_sdcard); expanded_buttons << addButton(layout, row++, col, ":/images/ic_location_on_48px.svg", &EmulatorWindow::slot_gps); expanded_buttons << addButton(layout, row++, col, ":/images/ic_signal_cellular_4_bar_48px.svg", &EmulatorWindow::slot_cellular); expanded_buttons << addButton(layout, row++, col, ":/images/ic_battery_std_48px.svg", &EmulatorWindow::slot_battery); expanded_buttons << addButton(layout, row++, col, ":/images/ic_photo_camera_48px.svg", &EmulatorWindow::slot_camera); expanded_buttons << addButton(layout, row++, col, ":/images/ic_call_48px.svg", &EmulatorWindow::slot_phone); expanded_buttons << addButton(layout, row++, col, ":/images/ic_filter_tilt_shift_48px.svg", &EmulatorWindow::slot_sensors); expanded_buttons << addButton(layout, row++, col, ":/images/ic_keyboard_arrow_left_48px.svg", &EmulatorWindow::slot_left); expanded_buttons << addButton(layout, row++, col, ":/images/ic_keyboard_arrow_down_48px.svg", &EmulatorWindow::slot_down); expanded_buttons << addButton(layout, row++, col, ":/images/ic_keyboard_arrow_up_48px.svg", &EmulatorWindow::slot_up); expanded_buttons << addButton(layout, row++, col, ":/images/ic_keyboard_arrow_right_48px.svg", &EmulatorWindow::slot_right); button_area = new QWidget(); button_area->setLayout(layout); top_layout->addWidget(button_area); setExpandedState(false); }
QWidget *dSettingUserWin::createWidget() { QWidget * widget = new QWidget(); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(1); layout->setSpacing(5); QGridLayout *layoutGrid = new QGridLayout(); layoutGrid->setSpacing(3); layoutGrid->setAlignment(Qt::AlignLeft); layoutGrid->addWidget ( new QLabel("Размер значков в режиме \"значки\": "), 0, 0 ,Qt::AlignRight); iconSizeToIconComboBox = new QComboBox; iconSizeToIconComboBox->addItem(tr("Маленькие (16x16)"),QSize(16,16)); iconSizeToIconComboBox->addItem(tr("Побольше (24x24)"),QSize(24,24)); iconSizeToIconComboBox->addItem(tr("Средние (32x32)"),QSize(32,32)); iconSizeToIconComboBox->addItem(tr("Стандартные (48x48)"),QSize(48,48)); iconSizeToIconComboBox->addItem(tr("Большие (64x64)"),QSize(64,64)); iconSizeToIconComboBox->setCurrentIndex(toInt(tr("icon_size_to_icon"),tr("value"),2)); connect(iconSizeToIconComboBox, SIGNAL(activated (int)), this, SLOT(sizeIconToIconActivated (int))); layoutGrid->addWidget( iconSizeToIconComboBox, 0, 1 ); layoutGrid->addWidget( new QLabel("Размер значков в режиме \"листа\": "),1,0 ); iconSizeToListComboBox = new QComboBox; iconSizeToListComboBox->addItem(tr("Маленькие (16x16)"),QSize(16,16)); iconSizeToListComboBox->addItem(tr("Побольше (24x24)"),QSize(24,24)); iconSizeToListComboBox->addItem(tr("Средние (32x32)"),QSize(32,32)); iconSizeToListComboBox->addItem(tr("Стандартные (48x48)"),QSize(48,48)); iconSizeToListComboBox->addItem(tr("Большие (64x64)"),QSize(64,64)); iconSizeToListComboBox->setCurrentIndex(toInt(tr("icon_size_to_list"),tr("value"),0)); connect(iconSizeToListComboBox, SIGNAL(activated (int)), this, SLOT(sizeIconToListActivated (int))); layoutGrid->addWidget (iconSizeToListComboBox,1,1 ); layoutGrid->addWidget( new QLabel("Размер значков в режиме \"таблица\": "),2,0 ); iconSizeToTableComboBox = new QComboBox; iconSizeToTableComboBox->addItem(tr("Маленькие (16x16)"),QSize(16,16)); iconSizeToTableComboBox->addItem(tr("Побольше (24x24)"),QSize(24,24)); // iconSizeToTableComboBox->addItem(tr("Средние (32x32)"),QSize(32,32)); // iconSizeToTableComboBox->addItem(tr("Стандартные (48x48)"),QSize(48,48)); // iconSizeToTableComboBox->addItem(tr("Большие (64x64)"),QSize(64,64)); iconSizeToTableComboBox->setCurrentIndex(toInt(tr("icon_size_to_table"),tr("value"),0)); connect(iconSizeToTableComboBox, SIGNAL(activated (int)), this, SLOT(sizeIconToTableActivated (int))); layoutGrid->addWidget (iconSizeToTableComboBox,2,1 ); layout->addItem(layoutGrid); widget->setLayout(layout); return widget; };
favoritos::favoritos(QWidget *parent) : QWidget(parent), ui(new Ui::favoritos) { ui->setupUi(this); setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); setAttribute(Qt::WA_TranslucentBackground); ui->pb1->setTipo(jbotao::retangulo); ui->pb2->setTipo(jbotao::retangulo); ui->pb3->setTipo(jbotao::retangulo); ui->pb4->setTipo(jbotao::retangulo); ui->pb5->setTipo(jbotao::retangulo); ui->pb6->setTipo(jbotao::retangulo); ui->pb7->setTipo(jbotao::retangulo); ui->pb8->setTipo(jbotao::retangulo); ui->pb9->setTipo(jbotao::retangulo); ui->pb10->setTipo(jbotao::retangulo); ui->pb11->setTipo(jbotao::retangulo); ui->pb12->setTipo(jbotao::retangulo); ui->pb13->setTipo(jbotao::retangulo); ui->pb14->setTipo(jbotao::retangulo); ui->pb15->setTipo(jbotao::retangulo); ui->pb16->setTipo(jbotao::retangulo); // layoutB->setAlignment(Qt::AlignTop); hideButtons(); totalBotoes = 0; QSettings settings("config.ini", QSettings::IniFormat); QString plataforma = settings.value("plataforma").toString(); QGridLayout *layout = new QGridLayout; layout->setAlignment(Qt::AlignLeft); setLayout(layout); setAcceptDrops(true); /* createList(); findInPath(); */ }
QLayout * PageCampaign::bodyLayoutDefinition() { QGridLayout * pageLayout = new QGridLayout(); pageLayout->setColumnStretch(0, 1); pageLayout->setColumnStretch(1, 2); pageLayout->setColumnStretch(2, 1); pageLayout->setRowStretch(0, 1); pageLayout->setRowStretch(3, 1); QGridLayout * infoLayout = new QGridLayout(); infoLayout->setColumnStretch(0, 1); infoLayout->setColumnStretch(1, 1); infoLayout->setColumnStretch(2, 1); infoLayout->setColumnStretch(3, 1); infoLayout->setColumnStretch(4, 1); infoLayout->setRowStretch(0, 1); infoLayout->setRowStretch(1, 1); // set this as default image first time page is created, this will change in hwform.cpp btnPreview = formattedButton(":/res/campaign/A_Classic_Fairytale/first_blood.png", true); infoLayout->setAlignment(btnPreview, Qt::AlignHCenter | Qt::AlignVCenter); lbldescription = new QLabel(); lbldescription->setAlignment(Qt::AlignHCenter| Qt::AlignTop); lbldescription->setWordWrap(true); lbltitle = new QLabel(); lbltitle->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); CBTeam = new QComboBox(this); CBMission = new QComboBox(this); CBCampaign = new QComboBox(this); infoLayout->addWidget(btnPreview,0,1,2,1); infoLayout->addWidget(lbltitle,0,2,1,2); infoLayout->addWidget(lbldescription,1,2,1,2); pageLayout->addLayout(infoLayout, 0, 0, 2, 3); pageLayout->addWidget(CBTeam, 2, 1); pageLayout->addWidget(CBCampaign, 3, 1); pageLayout->addWidget(CBMission, 4, 1); BtnStartCampaign = new QPushButton(this); BtnStartCampaign->setFont(*font14); BtnStartCampaign->setText(QPushButton::tr("Go!")); pageLayout->addWidget(BtnStartCampaign, 3, 2); return pageLayout; }