QGameServerState::QGameServerState(QWidget* parent) : QWidget(parent) { fObjectSel = new QComboBox(this); fSDLEditor = new QSDLEditor(this); QGridLayout* layout = new QGridLayout(this); layout->setContentsMargins(8, 8, 8, 8); layout->setHorizontalSpacing(8); layout->setVerticalSpacing(8); layout->addWidget(new QLabel(tr("Object:"), this), 0, 0); layout->addWidget(fObjectSel, 0, 1); layout->addWidget(fSDLEditor, 1, 1); connect(fObjectSel, SIGNAL(currentIndexChanged(int)), this, SLOT(objectChanged(int))); }
QWidget *TilesetItemBox::makeCategory(const QString &categoryItem) { QTabWidget *TileSetsCategories = ui->TileSetsCategories; QWidget *catWid; QWidget *scrollWid; QGridLayout *catLayout; QLabel *grpLabel; QComboBox *tilesetGroup; QSpacerItem *spItem; QScrollArea *TileSets; FlowLayout *theLayOut; catWid = new QWidget(); scrollWid = new QWidget(); catLayout = new QGridLayout(catWid); catLayout->setSpacing(0); catLayout->setContentsMargins(0, 0, 0, 0); grpLabel = new QLabel(catWid); grpLabel->setText(tr("Group:")); catLayout->addWidget(grpLabel, 0, 0, 1, 1); tilesetGroup = new QComboBox(catWid); catLayout->addWidget(tilesetGroup, 0, 1, 1, 1); tilesetGroup->setInsertPolicy(QComboBox::InsertAlphabetically); spItem = new QSpacerItem(1283, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); catLayout->addItem(spItem, 0, 2, 1, 1); TileSets = new QScrollArea(catWid); TileSets->setWidget(scrollWid); TileSets->setWidgetResizable(true); TileSets->setFrameShape(QFrame::StyledPanel); TileSets->setFrameShadow(QFrame::Raised); TileSets->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); TileSets->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); theLayOut = new FlowLayout(scrollWid); theLayOut->setSizeConstraint(QLayout::SetNoConstraint); catLayout->addWidget(TileSets, 1, 0, 1, 3); TileSetsCategories->addTab(catWid, QString()); TileSetsCategories->setTabText(TileSetsCategories->indexOf(catWid), categoryItem); return catWid; }
void setupUi(QDialog *administracion_Producto) { if (administracion_Producto->objectName().isEmpty()) administracion_Producto->setObjectName(QString::fromUtf8("administracion_Producto")); administracion_Producto->resize(492, 255); layoutWidget = new QWidget(administracion_Producto); layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); layoutWidget->setGeometry(QRect(80, 40, 349, 161)); gridLayout = new QGridLayout(layoutWidget); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); gridLayout->setContentsMargins(0, 0, 0, 0); list_Producto = new QListWidget(layoutWidget); list_Producto->setObjectName(QString::fromUtf8("list_Producto")); gridLayout->addWidget(list_Producto, 0, 0, 5, 1); Crear_Producto = new QPushButton(layoutWidget); Crear_Producto->setObjectName(QString::fromUtf8("Crear_Producto")); gridLayout->addWidget(Crear_Producto, 0, 1, 1, 1); Actualizar_Producto = new QPushButton(layoutWidget); Actualizar_Producto->setObjectName(QString::fromUtf8("Actualizar_Producto")); gridLayout->addWidget(Actualizar_Producto, 1, 1, 1, 1); Consultar_Producto = new QPushButton(layoutWidget); Consultar_Producto->setObjectName(QString::fromUtf8("Consultar_Producto")); gridLayout->addWidget(Consultar_Producto, 2, 1, 1, 1); Eliminar_Producto = new QPushButton(layoutWidget); Eliminar_Producto->setObjectName(QString::fromUtf8("Eliminar_Producto")); gridLayout->addWidget(Eliminar_Producto, 3, 1, 1, 1); Cancelar_Producto = new QPushButton(layoutWidget); Cancelar_Producto->setObjectName(QString::fromUtf8("Cancelar_Producto")); gridLayout->addWidget(Cancelar_Producto, 4, 1, 1, 1); retranslateUi(administracion_Producto); QMetaObject::connectSlotsByName(administracion_Producto); } // setupUi
Real3DDlg::Real3DDlg(QWidget* pParent, QSettings *pSettings) : QDialog(pParent, Qt::Tool), m_pSettings(pSettings), m_pStatus(new QStatusBar(this)), m_pPlot(new PlotGl(this, pSettings, 0.25)) { m_pPlot->SetEnabled(0); setWindowTitle("Real Space / Unit Cell"); m_pStatus->setSizeGripEnabled(1); if(m_pSettings) { QFont font; if(m_pSettings->contains("main/font_gen") && font.fromString(m_pSettings->value("main/font_gen", "").toString())) setFont(font); if(m_pSettings->contains("real3d/geo")) restoreGeometry(m_pSettings->value("real3d/geo").toByteArray()); else resize(640, 480); } m_pPlot->SetPrec(g_iPrecGfx); m_pPlot->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QGridLayout *gridLayout = new QGridLayout(this); gridLayout->setContentsMargins(4, 4, 4, 4); gridLayout->addWidget(m_pPlot, 0, 0, 1, 1); gridLayout->addWidget(m_pStatus, 1, 0, 1, 1); m_pPlot->AddHoverSlot([this](const PlotObjGl* pObj) { std::string strStatus; if(pObj) strStatus = pObj->strLabel; tl::find_all_and_replace<std::string>(strStatus, "\n", ", "); if(strStatus.length()) m_pStatus->showMessage(strStatus.c_str()); else m_pStatus->clearMessage(); }); m_pPlot->SetLabels("a", "b", "c"); m_pPlot->SetEnabled(1); }
/*! * // Tab "General" */ void XYDifferentiationCurveDock::setupGeneral() { QWidget* generalTab = new QWidget(ui.tabGeneral); uiGeneralTab.setupUi(generalTab); QGridLayout* gridLayout = dynamic_cast<QGridLayout*>(generalTab->layout()); if (gridLayout) { gridLayout->setContentsMargins(2,2,2,2); gridLayout->setHorizontalSpacing(2); gridLayout->setVerticalSpacing(2); } uiGeneralTab.cbDataSourceType->addItem(i18n("Spreadsheet")); uiGeneralTab.cbDataSourceType->addItem(i18n("XY-Curve")); cbDataSourceCurve = new TreeViewComboBox(generalTab); gridLayout->addWidget(cbDataSourceCurve, 5, 2, 1, 3); cbXDataColumn = new TreeViewComboBox(generalTab); gridLayout->addWidget(cbXDataColumn, 6, 2, 1, 3); cbYDataColumn = new TreeViewComboBox(generalTab); gridLayout->addWidget(cbYDataColumn, 7, 2, 1, 3); for (int i=0; i < NSL_DIFF_DERIV_ORDER_COUNT; i++) uiGeneralTab.cbDerivOrder->addItem(i18n(nsl_diff_deriv_order_name[i])); uiGeneralTab.pbRecalculate->setIcon( QIcon::fromTheme("run-build") ); QHBoxLayout* layout = new QHBoxLayout(ui.tabGeneral); layout->setMargin(0); layout->addWidget(generalTab); //Slots connect( uiGeneralTab.leName, SIGNAL(returnPressed()), this, SLOT(nameChanged()) ); connect( uiGeneralTab.leComment, SIGNAL(returnPressed()), this, SLOT(commentChanged()) ); connect( uiGeneralTab.chkVisible, SIGNAL(clicked(bool)), this, SLOT(visibilityChanged(bool)) ); connect( uiGeneralTab.cbDataSourceType, SIGNAL(currentIndexChanged(int)), this, SLOT(dataSourceTypeChanged(int)) ); connect( uiGeneralTab.cbAutoRange, SIGNAL(clicked(bool)), this, SLOT(autoRangeChanged()) ); connect( uiGeneralTab.sbMin, SIGNAL(valueChanged(double)), this, SLOT(xRangeMinChanged()) ); connect( uiGeneralTab.sbMax, SIGNAL(valueChanged(double)), this, SLOT(xRangeMaxChanged()) ); connect( uiGeneralTab.cbDerivOrder, SIGNAL(currentIndexChanged(int)), this, SLOT(derivOrderChanged()) ); connect( uiGeneralTab.sbAccOrder, SIGNAL(valueChanged(int)), this, SLOT(accOrderChanged()) ); connect( uiGeneralTab.pbRecalculate, SIGNAL(clicked()), this, SLOT(recalculateClicked()) ); connect( cbDataSourceCurve, SIGNAL(currentModelIndexChanged(QModelIndex)), this, SLOT(dataSourceCurveChanged(QModelIndex)) ); connect( cbXDataColumn, SIGNAL(currentModelIndexChanged(QModelIndex)), this, SLOT(xDataColumnChanged(QModelIndex)) ); connect( cbYDataColumn, SIGNAL(currentModelIndexChanged(QModelIndex)), this, SLOT(yDataColumnChanged(QModelIndex)) ); }
void OpenGLQtMenu::shaderMenuCallback(QObject* obj) { QSize id = qobject_cast<QAction*>(obj)->data().toSize(); int shaderId = id.width(); int type = id.height(); const std::vector<Shader*> shaders{ShaderManager::getPtr()->getShaders()}; auto it = std::find_if(shaders.begin(), shaders.end(), [shaderId](Shader* shader) -> bool { return static_cast<int>(shader->getID()) == shaderId; }); if (it != shaders.end()) { ShaderObject* shaderObj; switch (type) { case 1: shaderObj = (*it)->getVertexShaderObject(); break; case 2: shaderObj = (*it)->getGeometryShaderObject(); break; case 3: shaderObj = (*it)->getFragmentShaderObject(); break; default: return; } QMainWindow* win = static_cast<InviwoApplicationQt*>(InviwoApplication::getPtr())->getMainWindow(); QTextBrowser* shadercode = new QTextBrowser(nullptr); shadercode->setText(shaderObj->print(true).c_str()); shadercode->setStyleSheet("font: 12pt \"Courier\";"); QDialog* dialog = new QDialog(win); QGridLayout* layout = new QGridLayout(dialog); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addWidget(shadercode); dialog->setLayout(layout); dialog->resize(600, 800); dialog->exec(); delete dialog; } }
SpeexCodecWidget::SpeexCodecWidget() : CodecWidget(), currentFormat( "speex" ) { QGridLayout *grid = new QGridLayout( this ); grid->setContentsMargins( 0, 0, 0, 0 ); // set up encoding options selection QHBoxLayout *topBox = new QHBoxLayout(); grid->addLayout( topBox, 0, 0 ); QLabel *lMode = new QLabel( i18n("Mode:"), this ); topBox->addWidget( lMode ); cMode = new KComboBox( this ); cMode->addItem( i18n("Quality") ); cMode->addItem( i18n("Bitrate") ); connect( cMode, SIGNAL(activated(int)), this, SLOT(modeChanged(int)) ); connect( cMode, SIGNAL(activated(int)), SIGNAL(optionsChanged()) ); topBox->addWidget( cMode ); sQuality = new QSlider( Qt::Horizontal, this ); connect( sQuality, SIGNAL(valueChanged(int)), this, SLOT(qualitySliderChanged(int)) ); connect( sQuality, SIGNAL(valueChanged(int)), SIGNAL(optionsChanged()) ); topBox->addWidget( sQuality ); dQuality = new QDoubleSpinBox( this ); dQuality->setRange( 8, 160 ); dQuality->setSuffix( " kbps" ); dQuality->setFixedWidth( dQuality->sizeHint().width() ); connect( dQuality, SIGNAL(valueChanged(double)), this, SLOT(qualitySpinBoxChanged(double)) ); connect( dQuality, SIGNAL(valueChanged(double)), SIGNAL(optionsChanged()) ); topBox->addWidget( dQuality ); topBox->addStretch(); QHBoxLayout *midBox = new QHBoxLayout(); grid->addLayout( midBox, 1, 0 ); midBox->addStretch(); grid->setRowStretch( 2, 1 ); modeChanged( 0 ); }
RequestDetailsDlg::RequestDetailsDlg(Request* request, QWidget *parent) : QDialog(parent) ,m_request(request) ,m_gist(new Gist(parent)) { connect(m_gist, SIGNAL(published(QString)), this, SLOT(slotGistUrl(QString))); QGridLayout *gridLayout = new QGridLayout(this); QHBoxLayout *phLayout = new QHBoxLayout; QPushButton *cliboard = new QPushButton(QIcon(":/clipboard_32.png"), "", this); cliboard->setAutoDefault(false); cliboard->setToolTip(tr("Copy details of request/response to clipboard")); cliboard->setWhatsThis(tr("Send request/response to cliboard")); connect(cliboard, SIGNAL(clicked()), this, SLOT(slotSendToBuffer())); QPushButton *share = new QPushButton(QIcon(":/cloud302_32.png"), "", this); share->setAutoDefault(false); share->setToolTip(tr("Share request at gist")); share->setWhatsThis(tr("Share request at gist")); connect(share, SIGNAL(clicked()), this, SLOT(slotSendToGist())); phLayout->addWidget(cliboard); phLayout->addSpacing(2); phLayout->addWidget(share); m_viewRequest = new QTextEdit(this); m_viewRequest->setFont(QFont("Monospace")); m_viewRequest->setReadOnly(true); m_viewRequest->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); m_viewRequest->setHtml(m_request->requestToHtml()); m_viewResponse = new QTextEdit(this); m_viewResponse->setFont(QFont("Monospace")); m_viewResponse->setReadOnly(true); m_viewResponse->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); m_viewResponse->setHtml(m_request->responseToHtml()); gridLayout->addItem(phLayout, 0, 0, 1, 2, Qt::AlignLeft); gridLayout->addWidget(m_viewRequest, 1, 0, 1, 1); gridLayout->addWidget(m_viewResponse, 1, 1, 1, 1); gridLayout->setContentsMargins(0,0,0,0); gridLayout->setMargin(0); resize(900, 500); }
/*! * // Tab "General" */ void XYFourierTransformCurveDock::setupGeneral() { QWidget* generalTab = new QWidget(ui.tabGeneral); uiGeneralTab.setupUi(generalTab); QGridLayout* gridLayout = dynamic_cast<QGridLayout*>(generalTab->layout()); if (gridLayout) { gridLayout->setContentsMargins(2,2,2,2); gridLayout->setHorizontalSpacing(2); gridLayout->setVerticalSpacing(2); } cbXDataColumn = new TreeViewComboBox(generalTab); gridLayout->addWidget(cbXDataColumn, 5, 2, 1, 2); cbYDataColumn = new TreeViewComboBox(generalTab); gridLayout->addWidget(cbYDataColumn, 6, 2, 1, 2); for (int i=0; i < NSL_SF_WINDOW_TYPE_COUNT; i++) uiGeneralTab.cbWindowType->addItem(i18n(nsl_sf_window_type_name[i])); for (int i=0; i < NSL_DFT_RESULT_TYPE_COUNT; i++) uiGeneralTab.cbType->addItem(i18n(nsl_dft_result_type_name[i])); for (int i=0; i < NSL_DFT_XSCALE_COUNT; i++) uiGeneralTab.cbXScale->addItem(i18n(nsl_dft_xscale_name[i])); QHBoxLayout* layout = new QHBoxLayout(ui.tabGeneral); layout->setMargin(0); layout->addWidget(generalTab); //Slots connect( uiGeneralTab.leName, SIGNAL(returnPressed()), this, SLOT(nameChanged()) ); connect( uiGeneralTab.leComment, SIGNAL(returnPressed()), this, SLOT(commentChanged()) ); connect( uiGeneralTab.chkVisible, SIGNAL(clicked(bool)), this, SLOT(visibilityChanged(bool)) ); connect( uiGeneralTab.cbAutoRange, SIGNAL(clicked(bool)), this, SLOT(autoRangeChanged()) ); connect( uiGeneralTab.sbMin, SIGNAL(valueChanged(double)), this, SLOT(xRangeMinChanged()) ); connect( uiGeneralTab.sbMax, SIGNAL(valueChanged(double)), this, SLOT(xRangeMaxChanged()) ); connect( uiGeneralTab.cbWindowType, SIGNAL(currentIndexChanged(int)), this, SLOT(windowTypeChanged()) ); connect( uiGeneralTab.cbType, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged()) ); connect( uiGeneralTab.cbTwoSided, SIGNAL(stateChanged(int)), this, SLOT(twoSidedChanged()) ); connect( uiGeneralTab.cbShifted, SIGNAL(stateChanged(int)), this, SLOT(shiftedChanged()) ); connect( uiGeneralTab.cbXScale, SIGNAL(currentIndexChanged(int)), this, SLOT(xScaleChanged()) ); // connect( uiGeneralTab.pbOptions, SIGNAL(clicked()), this, SLOT(showOptions()) ); connect( uiGeneralTab.pbRecalculate, SIGNAL(clicked()), this, SLOT(recalculateClicked()) ); }
EdLevelPropertyVector2Field::EdLevelPropertyVector2Field (EdLevelPropertiesWindow *parent, std::shared_ptr<PlugNode> node, std::shared_ptr<ArchiveData> data) { //setFrameStyle(QFrame::StyledPanel | QFrame::Raised); _data = data; _node = node; buildStatusButtons(); QLabel *name = new QLabel(this); name->setMaximumWidth(130); name->setMinimumWidth(130); name->setText(MoreStrings::captialize_and_format(_data->title()).c_str()); _value_x = new EdLevelLineEdit(this); _value_y = new EdLevelLineEdit(this); _value_x->setObjectName("prop"); _value_y->setObjectName("prop"); connect( _value_x, SIGNAL(editingFinished()), this, SLOT(doWriteParams()) ); connect( _value_y, SIGNAL(editingFinished()), this, SLOT(doWriteParams()) ); connect( this, SIGNAL(doCommand(QString, bool)), parent, SLOT(onCommand(QString, bool)) ); QGridLayout *layout = new QGridLayout; layout->setContentsMargins(0,0,0,0); layout->setHorizontalSpacing(0); layout->setVerticalSpacing(0); layout->addWidget(keyButton(),0,0); layout->addWidget(hasInputButton(),0,1); layout->addWidget(hasOutputButton(),0,2); layout->addWidget(name,0,3); layout->addWidget(_value_x,0,4); layout->addWidget(_value_y,0,5); setLayout(layout); setMinimumHeight(15+2); doReadParams(); }
/** * Constructs a new SynapseDetailWidget. */ SynapseDetailWidget::SynapseDetailWidget(NeuralNetworkEditor *owner) : EditorToolWidget(owner), mInitialized(false), mSynapse(0), mStrengthValue(0), mEnabledValue(0), mUpdatingChangedSelection(false) { QVBoxLayout *layout = new QVBoxLayout(this); setLayout(layout); QGridLayout *synapseLayout = new QGridLayout(); layout->addLayout(synapseLayout); QWidget *strengthArea = new QWidget(this); mObserveStrengthField = new QCheckBox(strengthArea); mObserveStrengthField->setChecked(true); QGridLayout *strengthFieldLayout = new QGridLayout(strengthArea); strengthFieldLayout->setContentsMargins(0, 0, 0, 0); strengthFieldLayout->addWidget(mObserveStrengthField, 0, 1); mSynapseStrengthField = new QLineEdit("", strengthArea); strengthFieldLayout->addWidget(mSynapseStrengthField, 0, 0); synapseLayout->addWidget(new QLabel("Weight:", this), 0, 0); synapseLayout->addWidget(strengthArea, 0, 1); mEnableSynapseCheckBox = new QCheckBox(this); synapseLayout->addWidget(new QLabel("Disable:", this), 1, 0); synapseLayout->addWidget(mEnableSynapseCheckBox, 1, 1); QGroupBox *synapseFunctionBox = new QGroupBox("SynapseFunction", this); QVBoxLayout *sfBoxLayout = new QVBoxLayout(); sfBoxLayout->setContentsMargins(4, 4, 4, 4); synapseFunctionBox->setLayout(sfBoxLayout); layout->addWidget(synapseFunctionBox); mSynapseFunctionSelector = new QComboBox(synapseFunctionBox); sfBoxLayout->addWidget(mSynapseFunctionSelector); mSynapseFunctionParameterEditor = new ParameterEditor(synapseFunctionBox, mEditor); sfBoxLayout->addWidget(mSynapseFunctionParameterEditor); if(mEditor != 0) { connect(mEditor, SIGNAL(tabSelectionChanged(int)), this, SLOT(currentEditorTabChanged(int))); }
void SiteEditPanel::createSitePage() { m_pgSite = new QWidget(this); m_txtSite = new QLineEdit(m_pgSite); QLabel * lblSite = new QLabel(tr("Dive &Site"), m_pgSite); lblSite->setBuddy(m_txtSite); m_txtPlace = new QLineEdit(m_pgSite); QLabel * lblPlace = new QLabel(tr("&Place"), m_pgSite); lblPlace->setBuddy(m_txtPlace); m_cbxCountry = new QComboBox(m_pgSite); m_cbxCountry->setModel(new CountryModel()); QLabel * lblCountry = new QLabel(tr("&Country"), m_pgSite); lblCountry->setBuddy(m_cbxCountry); m_cbxSalinity = new QComboBox(m_pgSite); m_cbxSalinity->addItem("fresh"); m_cbxSalinity->addItem("salt"); QLabel * lblSalinity = new QLabel(tr("Sali&nity"), m_pgSite); lblSalinity->setBuddy(m_cbxSalinity); QGridLayout * gbox = new QGridLayout(); gbox->setContentsMargins(0, 0, 0, 0); gbox->addWidget(lblSite, 0, 0); gbox->addWidget(m_txtSite, 1, 0); gbox->setRowMinimumHeight(2, 8); gbox->addWidget(lblPlace, 3, 0); gbox->addWidget(m_txtPlace, 4, 0); gbox->setRowMinimumHeight(5, 8); gbox->addWidget(lblCountry, 6, 0); gbox->addWidget(m_cbxCountry, 7, 0); gbox->setRowMinimumHeight(8, 8); gbox->addWidget(lblSalinity, 9, 0); gbox->addWidget(m_cbxSalinity, 10, 0); gbox->setRowMinimumHeight(11, 8); QVBoxLayout * vbox = new QVBoxLayout(); vbox->addLayout(gbox); vbox->addStretch(); m_pgSite->setLayout(vbox); }
QgsGeometryCheckerFixDialog::QgsGeometryCheckerFixDialog( QgsGeometryChecker *checker, const QList<QgsGeometryCheckError *> &errors, QgisInterface* iface, QWidget *parent ) : QDialog( parent ) , mChecker( checker ) , mErrors( errors ) , mIface( iface ) { setWindowTitle( tr( "Fix errors" ) ); QGridLayout* layout = new QGridLayout(); layout->setContentsMargins( 4, 4, 4, 4 ); setLayout( layout ); mResolutionsBox = new QGroupBox(); mResolutionsBox->setFlat( true ); mResolutionsBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ); layout->addWidget( mResolutionsBox, 0, 0, 1, 2 ); mStatusLabel = new QLabel(); layout->addWidget( mStatusLabel, 1, 0, 1, 2 ); mButtonBox = new QDialogButtonBox( QDialogButtonBox::Abort, Qt::Horizontal ); mNextBtn = mButtonBox->addButton( tr( "Next" ), QDialogButtonBox::ActionRole ); mFixBtn = mButtonBox->addButton( tr( "Fix" ), QDialogButtonBox::ActionRole ); mSkipBtn = mButtonBox->addButton( tr( "Skip" ), QDialogButtonBox::ActionRole ); mNextBtn->setAutoDefault( true ); mFixBtn->setAutoDefault( true ); layout->addWidget( mButtonBox, 2, 0, 1, 1 ); mProgressBar = new QProgressBar(); mProgressBar->setRange( 0, errors.size() ); mProgressBar->setValue( 0 ); layout->addWidget( mProgressBar, 2, 1, 1, 1 ); mRadioGroup = new QButtonGroup( this ); connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); connect( mNextBtn, SIGNAL( clicked() ), this, SLOT( setupNextError() ) ); connect( mFixBtn, SIGNAL( clicked() ), this, SLOT( fixError() ) ); connect( mSkipBtn, SIGNAL( clicked() ), this, SLOT( skipError() ) ); }
EmbossTool::EmbossTool(QObject* const parent) : EditorToolThreaded(parent), d(new Private) { setObjectName(QLatin1String("emboss")); setInitPreview(true); // ------------------------------------------------------------- d->gboxSettings = new EditorToolSettings(nullptr); d->previewWidget = new ImageRegionWidget; // ------------------------------------------------------------- QLabel* label1 = new QLabel(i18n("Depth:")); d->depthInput = new DIntNumInput; d->depthInput->setRange(10, 300, 1); d->depthInput->setDefaultValue(30); d->depthInput->setWhatsThis( i18n("Set here the depth of the embossing image effect.") ); // ------------------------------------------------------------- const int spacing = d->gboxSettings->spacingHint(); QGridLayout* mainLayout = new QGridLayout; mainLayout->addWidget(label1, 0, 0, 1, 2); mainLayout->addWidget(d->depthInput, 1, 0, 1, 2); mainLayout->setRowStretch(2, 10); mainLayout->setContentsMargins(spacing, spacing, spacing, spacing); mainLayout->setSpacing(spacing); d->gboxSettings->plainPage()->setLayout(mainLayout); // ------------------------------------------------------------- setToolSettings(d->gboxSettings); setToolView(d->previewWidget); setPreviewModeMask(PreviewToolBar::AllPreviewModes); // ------------------------------------------------------------- connect(d->depthInput, SIGNAL(valueChanged(int)), this, SLOT(slotTimer())); }
MacCodecWidget::MacCodecWidget() : CodecWidget(), currentFormat( "ape" ) { QGridLayout *grid = new QGridLayout( this ); grid->setContentsMargins( 0, 0, 0, 0 ); // set up encoding options selection QHBoxLayout *topBox = new QHBoxLayout(); grid->addLayout( topBox, 0, 0 ); QLabel *lCompressionLevel = new QLabel( i18n("Compression level:"), this ); topBox->addWidget( lCompressionLevel ); sCompressionLevel = new QSlider( Qt::Horizontal, this ); sCompressionLevel->setRange( 1, 5 ); sCompressionLevel->setSingleStep( 1 ); sCompressionLevel->setPageStep( 1 ); // sQuality->setTickPosition( QSlider::TicksBelow ); // sQuality->setFixedWidth( sQuality->sizeHint().width() ); connect( sCompressionLevel, SIGNAL(valueChanged(int)), this, SLOT(compressionLevelSliderChanged(int)) ); connect( sCompressionLevel, SIGNAL(valueChanged(int)), SIGNAL(optionsChanged()) ); topBox->addWidget( sCompressionLevel ); sCompressionLevel->setToolTip( i18n("Compression level from %1 to %2 where %2 is the best compression.\nThe better the compression, the slower the conversion but the smaller the file size and vice versa.", 1000, 5000) ); iCompressionLevel = new QSpinBox( this ); iCompressionLevel->setRange( 1, 5 ); iCompressionLevel->setSingleStep( 1 ); iCompressionLevel->setSuffix( "000" ); iCompressionLevel->setFixedWidth( iCompressionLevel->sizeHint().width() ); // dQuality->setFixedHeight( cMode->minimumSizeHint().height() ); connect( iCompressionLevel, SIGNAL(valueChanged(int)), this, SLOT(compressionLevelSpinBoxChanged(int)) ); connect( iCompressionLevel, SIGNAL(valueChanged(int)), SIGNAL(optionsChanged()) ); topBox->addWidget( iCompressionLevel ); iCompressionLevel->setToolTip( i18n("Compression level from %1 to %2 where %2 is the best compression.\nThe better the compression, the slower the conversion but the smaller the file size and vice versa.", 1000, 5000) ); topBox->addStretch(); grid->setRowStretch( 1, 1 ); iCompressionLevel->setValue( 2 ); }
/*! * \brief FetchInterfaceDataDialog::FetchInterfaceDataDialog * \param pLibraryTreeItem * \param pMainWindow */ FetchInterfaceDataDialog::FetchInterfaceDataDialog(LibraryTreeItem *pLibraryTreeItem, MainWindow *pMainWindow) : QDialog(pMainWindow), mpMainWindow(pMainWindow), mpLibraryTreeItem(pLibraryTreeItem) { setWindowTitle(QString(Helper::applicationName).append(" - ").append(tr("Fetch Interface Data")).append(" - ") .append(mpLibraryTreeItem->getName())); setAttribute(Qt::WA_DeleteOnClose); setMinimumWidth(550); mpLibraryTreeItem = pLibraryTreeItem; // progress mpProgressLabel = new Label; mpProgressLabel->setTextFormat(Qt::RichText); mpProgressBar = new QProgressBar; mpProgressBar->setAlignment(Qt::AlignHCenter); // cancel button mpCancelButton = new QPushButton(Helper::cancel); connect(mpCancelButton, SIGNAL(clicked()), SLOT(cancelFetchingInterfaceData())); // try again button mpFetchAgainButton = new QPushButton(tr("Fetch Again")); mpFetchAgainButton->setEnabled(false); connect(mpFetchAgainButton, SIGNAL(clicked()), SLOT(fetchAgainInterfaceData())); // output mpOutputLabel = new Label(Helper::output); mpOutputTextBox = new QPlainTextEdit; mpOutputTextBox->setFont(QFont(Helper::monospacedFontInfo.family())); // main Layout QGridLayout *pMainGridLayout = new QGridLayout; pMainGridLayout->setContentsMargins(5, 5, 5, 5); pMainGridLayout->addWidget(mpProgressLabel, 0, 0, 1, 3); pMainGridLayout->addWidget(mpProgressBar, 1, 0); pMainGridLayout->addWidget(mpCancelButton, 1, 1); pMainGridLayout->addWidget(mpFetchAgainButton, 1, 2); pMainGridLayout->addWidget(mpOutputLabel, 2, 0, 1, 3); pMainGridLayout->addWidget(mpOutputTextBox, 3, 0, 1, 3); setLayout(pMainGridLayout); // create the thread mpFetchInterfaceDataThread = new FetchInterfaceDataThread(this); connect(mpFetchInterfaceDataThread, SIGNAL(sendManagerStarted()), SLOT(managerProcessStarted())); connect(mpFetchInterfaceDataThread, SIGNAL(sendManagerOutput(QString,StringHandler::SimulationMessageType)), SLOT(writeManagerOutput(QString,StringHandler::SimulationMessageType))); connect(mpFetchInterfaceDataThread, SIGNAL(sendManagerFinished(int,QProcess::ExitStatus)), SLOT(managerProcessFinished(int,QProcess::ExitStatus))); mpFetchInterfaceDataThread->start(); }
void ParamWidget::initPopup() { QGridLayout* popupLayout = new QGridLayout(0); popupLayout->setContentsMargins(0,0,0,0); m_pLineName = new KLineEdit(0); m_pLineName->setContentsMargins(0,0,0,0); m_pLineName->setClickMessage("name"); m_pLineName->installEventFilter(m_pPopup); popupLayout->addWidget(m_pLineName,0,0,1,1); m_pInOut = new QComboBox(0); m_pInOut->setContentsMargins(0,0,0,0); m_pInOut->installEventFilter(m_pPopup); QStringList caseList; caseList << "In" << "Out" << "In/Out"; m_pInOut->addItems(caseList); popupLayout->addWidget(m_pInOut,0,1,1,1); m_pInitVal = new KLineEdit(0); m_pInitVal->setContentsMargins(0,0,0,0); m_pInitVal->installEventFilter(m_pPopup); m_pInitVal->setClickMessage("value"); m_pInitVal->setMaximumWidth(100); popupLayout->addWidget(m_pInitVal,0,2,1,1); m_pDoc = new KLineEdit(0); m_pDoc->setContentsMargins(0,0,0,0); m_pDoc->installEventFilter(m_pPopup); m_pDoc->setClickMessage("documentation"); popupLayout->addWidget(m_pDoc,1,0,1,3); m_pOkButton = new QPushButton(0); m_pOkButton->setMinimumSize(0,0); m_pOkButton->installEventFilter(m_pPopup); m_pOkButton->setMaximumWidth(30); m_pOkButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding)); m_pOkButton->setContentsMargins(0,0,0,0); m_pOkButton->setIcon(KIcon("dialog-ok")); popupLayout->addWidget(m_pOkButton,0,3,2,1); setPopupLayout(popupLayout); connect(m_pOkButton, SIGNAL( clicked(bool) ), this, SLOT( slotOkClicked() ) ); }
TermWidgetHolder::TermWidgetHolder(const QString & wdir, const QString & shell, QWidget * parent) : QWidget(parent), m_wdir(wdir), m_shell(shell), m_currentTerm(0) { setFocusPolicy(Qt::NoFocus); QGridLayout * lay = new QGridLayout(this); lay->setSpacing(0); lay->setContentsMargins(0, 0, 0, 0); QSplitter *s = new QSplitter(this); s->setFocusPolicy(Qt::NoFocus); TermWidget *w = newTerm(); s->addWidget(w); lay->addWidget(s); setLayout(lay); }
//********************************************************************** bool TulipApp::createController(const string &name,const string &graphName) { if(!controllerAutoLoad) { /*if(currentController) { Graph *graph=currentController->getGraph(); if(askSaveGraph(graph->getAttribute<string>("name"))) return false; } delete currentController; newWorkspace->closeAllWindows();*/ QWidget *tab=new QWidget(); QGridLayout *gridLayout = new QGridLayout(tab); gridLayout->setContentsMargins(1,1,1,1); QWorkspace *newWorkspace=new QWorkspace(tab); newWorkspace->setBackground(QBrush(QPixmap(QString::fromUtf8(":/background_logo.png")))); gridLayout->addWidget(newWorkspace, 0, 0, 1, 1); int index=tabWidget->addTab(tab, QString::fromUtf8(graphName.c_str())); tabWidget->setCurrentIndex(index); loadInterface(-1); Controller *newController=ControllerPluginsManager::getInst().createController(name); toolBar->setWindowTitle("Tool Bar"); graphToolBar->setWindowTitle("Interactors Tool Bar"); newController->attachMainWindow(MainWindowFacade(this,toolBar,graphToolBar,newWorkspace)); tabIndexToController[index]=newController; controllerToControllerName[newController]=name; controllerToWorkspace[newController]=newWorkspace; //Set Qt object names tab->setObjectName(QString("ControllerMainWidget ")+QString::number(index)); newWorkspace->setObjectName(QString("ControllerWorkspace ")+QString::number(index)); } else { controllerAutoLoad=false; tabWidget->setTabText(0, QString::fromUtf8(graphName.c_str())); } Controller::currentActiveController(tabIndexToController[tabWidget->currentIndex()]); return true; }
DADpast::DADpast(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); QGridLayout *Mainlayout = new QGridLayout; Mainlayout->setContentsMargins(0, 70, 0, 0); screen = new Screen(); screen2 = new Screen(); QScrollArea *scrollArea = new QScrollArea; scrollArea->setWidget(screen); Mainlayout->addWidget(scrollArea); QScrollArea *scrollArea2 = new QScrollArea; scrollArea2->setWidget(screen2); Mainlayout->addWidget(scrollArea2); ui.centralWidget->setLayout(Mainlayout); radius = 15.0; isrc = NULL; itarget = NULL; tmp = NULL; itargetOn = NULL; isrcOn = NULL; WIDTH = 800; HEIGHT = 500; QObject::connect(ui.actionInput_src, SIGNAL(triggered()), this, SLOT(readSrc())); QObject::connect(ui.actionInput_target, SIGNAL(triggered()), this, SLOT(readTarget())); QObject::connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(initDraw())); QObject::connect(ui.pushButton_2, SIGNAL(clicked()), this, SLOT(DragDrop())); QObject::connect(ui.pushButton_3, SIGNAL(clicked()), this, SLOT(ImageBlend())); QObject::connect(screen, SIGNAL(mouseMove(QPoint&)), this, SLOT(mouseMove(QPoint&))); QObject::connect(screen, SIGNAL(mousePress(QPoint&)), this, SLOT(mousePress(QPoint&))); QObject::connect(screen, SIGNAL(mouseRelease(QPoint&)), this, SLOT(mouseRelease(QPoint&))); QObject::connect(screen2, SIGNAL(mouseMove(QPoint&)), this, SLOT(mouseMove(QPoint&))); QObject::connect(screen2, SIGNAL(mousePress(QPoint&)), this, SLOT(mousePress(QPoint&))); QObject::connect(screen2, SIGNAL(mouseRelease(QPoint&)), this, SLOT(mouseRelease(QPoint&))); }
FilterBuilder::FilterBuilder(QWidget *parent) : QWidget(parent) { filterCombo = new QComboBox; filterCombo->setObjectName("filterCombo"); for (int i = 0; i < CardFilter::AttrEnd; i++) filterCombo->addItem( tr(CardFilter::attrName(static_cast<CardFilter::Attr>(i))), QVariant(i) ); typeCombo = new QComboBox; typeCombo->setObjectName("typeCombo"); for (int i = 0; i < CardFilter::TypeEnd; i++) typeCombo->addItem( tr(CardFilter::typeName(static_cast<CardFilter::Type>(i))), QVariant(i) ); QPushButton *ok = new QPushButton(QPixmap("theme:icons/increment"), QString()); ok->setObjectName("ok"); ok->setMaximumSize(20, 20); edit = new QLineEdit; edit->setObjectName("edit"); edit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QGridLayout *layout = new QGridLayout; layout->setObjectName("layout"); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(typeCombo, 0, 0, 1, 2); layout->addWidget(filterCombo, 0, 2, 1, 2); layout->addWidget(edit, 1, 0, 1, 3); layout->addWidget(ok, 1, 3); setLayout(layout); connect(edit, SIGNAL(returnPressed()), this, SLOT(emit_add())); connect(ok, SIGNAL(released()), this, SLOT(emit_add())); fltr = NULL; }
/*! * \brief AbstractAnimationWindow::AbstractAnimationWindow * \param pParent */ AbstractAnimationWindow::AbstractAnimationWindow(QWidget *pParent) : QMainWindow(pParent), // osgViewer::CompositeViewer(), mPathName(""), mFileName(""), mpVisualizer(nullptr), mpViewerWidget(nullptr), mpAnimationToolBar(new QToolBar(QString("Animation Toolbar"),this)), mpAnimationChooseFileAction(nullptr), mpAnimationInitializeAction(nullptr), mpAnimationPlayAction(nullptr), mpAnimationPauseAction(nullptr), mpAnimationSlider(nullptr), mpAnimationTimeLabel(nullptr), mpTimeTextBox(nullptr), mpAnimationSpeedLabel(nullptr), mpSpeedComboBox(nullptr), mpPerspectiveDropDownBox(nullptr), mpRotateCameraLeftAction(nullptr), mpRotateCameraRightAction(nullptr), mCameraInitialized(false) { // to distinguish this widget as a subwindow among the plotwindows setObjectName(QString("animationWidget")); //the viewer widget mpViewerWidget = new ViewerWidget(this); // we need to set the minimum height so that visualization window is still shown when we cascade windows. mpViewerWidget->setMinimumHeight(100); // toolbar icon size int toolbarIconSize = OptionsDialog::instance()->getGeneralSettingsPage()->getToolbarIconSizeSpinBox()->value(); mpAnimationToolBar->setIconSize(QSize(toolbarIconSize, toolbarIconSize)); addToolBar(Qt::TopToolBarArea, mpAnimationToolBar); // Viewer layout QGridLayout *pGridLayout = new QGridLayout; pGridLayout->setContentsMargins(0, 0, 0, 0); pGridLayout->addWidget(mpViewerWidget); // add the viewer to the frame for boxed rectangle around it. QFrame *pCentralWidgetFrame = new QFrame; pCentralWidgetFrame->setFrameStyle(QFrame::StyledPanel); pCentralWidgetFrame->setLayout(pGridLayout); setCentralWidget(pCentralWidgetFrame); }
QCefView::QCefView(const QString url, QWidget* parent /*= 0*/) : QWidget(parent) , cefWindow_(NULL) { QGridLayout* layout = new QGridLayout; layout->setContentsMargins(0, 0, 0, 0); /* * Here we must create a QWidget as a wrapper * to encapsulate the QWindow */ cefWindow_ = new CCefWindow(url, this, window()->windowHandle()); QWidget* windowContainer = createWindowContainer(cefWindow_, this); if (windowContainer) { layout->addWidget(windowContainer); } setLayout(layout); }
void OsgForm::buildLayerBox() { QGridLayout *grid = new QGridLayout(ui->layerFrame); for (int row=0 ; row < numRowsOfLayerButtons ; row++) { for (int col=0 ; col < numColsOfLayerButtons ; col++) { QCheckBox * cb = new QCheckBox(ui->layerFrame); cb->setCheckable(true); cb->setChecked(false); cb->setMinimumWidth(12); cb->setMinimumHeight(16); grid->addWidget(cb, row, (numColsOfLayerButtons-1)-col); connect(cb, SIGNAL(stateChanged(int)), this, SLOT(tweakCameraMaskBit(int))); m_checkBoxes.append(cb); } } grid->setHorizontalSpacing(0); grid->setVerticalSpacing(0); grid->setContentsMargins(0,0,0,0); }
MagicEncoderWavConfig::MagicEncoderWavConfig( MagicEncoderWav *encoder, QWidget *parent, QAction *toggleEnableAction ) : MagicEncoderConfig( parent, toggleEnableAction ) , mpEncoder( encoder ) { QGridLayout *mainLayout = new QGridLayout( this ); mainLayout->setContentsMargins( 3, 3, 3, 3 ); mainLayout->addWidget( mpUseEncoder, 0, 0, 1, 3 ); mainLayout->addWidget( mpDirOverride, 1, 0, 1, 3 ); mainLayout->addWidget( new QLabel( tr("Base Directory:") ), 2, 0 ); mainLayout->addWidget( mpDirEdit, 2, 1 ); mainLayout->addWidget( mpDotButton, 2, 2 ); mainLayout->setColumnStretch( 1, 1 ); mainLayout->setRowStretch( 3, 1 ); setLayout( mainLayout ); readSettings(); }
void MainWindowImpl::launchNewBoardView() { const qreal zm(0.25); QBoardView * v = new QBoardView( this->impl->gstate ); v->zoom(zm); QDockWidget * win = new QDockWidget( "QBoard View", this ); win->setAttribute(Qt::WA_DeleteOnClose); #if 0 QWidget * frame = new QWidget(); QGridLayout * lay = new QGridLayout(frame); lay->setSpacing(1); lay->setContentsMargins(2,2,2,2); lay->addWidget( v ); win->setWidget(frame); this->addDockWidget(Qt::RightDockWidgetArea, win ); #else win->setWidget( v ); this->addDockWidget(Qt::RightDockWidgetArea, win ); #endif }
QWidget* QgsWebViewWidgetWrapper::createWidget( QWidget* parent ) { QWidget* container = new QWidget( parent ); QGridLayout* layout = new QGridLayout(); QgsFilterLineEdit* le = new QgsFilterLineEdit(); QWebView* webView = new QWebView(); webView->setObjectName( "EditorWebView" ); QPushButton* pb = new QPushButton( tr( "..." ) ); pb->setObjectName( "FileChooserButton" ); layout->addWidget( webView, 0, 0, 1, 2 ); layout->addWidget( le, 1, 0 ); layout->addWidget( pb, 1, 1 ); layout->setMargin( 0 ); layout->setContentsMargins( 0, 0, 0, 0 ); container->setLayout( layout ); return container; }
/* QWin32Sound */ QWin32Sound::QWin32Sound(plCreatable* pCre, QWidget* parent) : QCreatable(pCre, pCre->ClassIndex(), parent) { plWin32Sound* obj = plWin32Sound::Convert(fCreatable); fSoundLink = new QCreatableLink(this, false); fSoundLink->setText(tr("Sound Properties")); fSoundLink->setCreatable(obj); fSoundLink->setForceType(kSound); fChannel = new QComboBox(this); fChannel->addItems(QStringList() << "Left" << "Right"); fChannel->setCurrentIndex(obj->getChannel()); QGridLayout* layout = new QGridLayout(this); layout->setContentsMargins(8, 8, 8, 8); layout->addWidget(fSoundLink, 0, 0, 1, 2); layout->addWidget(new QLabel(tr("Channel:"), this), 1, 0); layout->addWidget(fChannel, 1, 1); }
QWidget* QgsPhotoWidgetWrapper::createWidget( QWidget* parent ) { QWidget* container = new QWidget( parent ); QGridLayout* layout = new QGridLayout(); QgsFilterLineEdit* le = new QgsFilterLineEdit(); QgsPixmapLabel* label = new QgsPixmapLabel(); label->setObjectName( "PhotoLabel" ); QPushButton* pb = new QPushButton( tr( "..." ) ); pb->setObjectName( "FileChooserButton" ); layout->addWidget( label, 0, 0, 1, 2 ); layout->addWidget( le, 1, 0 ); layout->addWidget( pb, 1, 1 ); layout->setMargin( 0 ); layout->setContentsMargins( 0, 0, 0, 0 ); container->setLayout( layout ); return container; }
EditView::EditView(std::shared_ptr<File> file, std::shared_ptr<CoreConnection> connection, QWidget *parent) : QWidget(parent) { setFocusPolicy(Qt::FocusPolicy::NoFocus); setAttribute(Qt::WA_KeyCompression, false); setAttribute(Qt::WA_StaticContents); setAttribute(Qt::WA_Resized); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setContentsMargins(0, 0, 0, 0); m_content = new ContentView(file, connection, this); m_scrollBarV = new QScrollBar(this); m_scrollBarH = new QScrollBar(Qt::Horizontal, this); QGridLayout *layout = new QGridLayout(); layout->addWidget(m_content, 1, 1); layout->addWidget(m_scrollBarV, 1, 2); layout->addWidget(m_scrollBarH, 2, 1); layout->setContentsMargins(0, 0, 0, 0); layout->setMargin(0); layout->setSpacing(0); this->setLayout(layout); connect(m_scrollBarV, &QScrollBar::valueChanged, this, &EditView::scrollBarVChanged); connect(m_scrollBarH, &QScrollBar::valueChanged, this, &EditView::scrollBarHChanged); //QFile qss(":/resources/qss/scroll_bar.qss"); //qss.open(QFile::ReadOnly); //auto scrollBarStyle = qss.readAll(); //m_scrollBarV->setStyleSheet(scrollBarStyle); //m_scrollBarH->setStyleSheet(scrollBarStyle); m_scrollTester = std::make_unique<ScrollTester>(this); auto seq = QKeySequence("F8"); Shortcuts::shared()->append(this, seq, [&](QShortcut *shortcut) { shortcut->setContext(Qt::WidgetWithChildrenShortcut); connect(shortcut, &QShortcut::activated, this, &EditView::scrollTester); }); m_fpsCounter = new FpsCounterWidget(this); }