CachesSizeDialog::CachesSizeDialog(QWidget* parent) : QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint) { setWindowTitle("Caches Size"); // Create layouter QFormLayout* form = new QFormLayout(this); setLayout(form); form->addRow("Animations cache size (MB):", _animations = createDoubleSpinBox(this)); form->addRow("Geometries cache size (MB):", _geometries = createDoubleSpinBox(this)); form->addRow("Sounds cache size (MB):", _sounds = createDoubleSpinBox(this)); form->addRow("Textures cache size (MB):", _textures = createDoubleSpinBox(this)); resetClicked(true); // Add a button to reset QPushButton* confirmButton = new QPushButton("Confirm", this); QPushButton* resetButton = new QPushButton("Reset", this); form->addRow(confirmButton, resetButton); connect(confirmButton, SIGNAL(clicked(bool)), this, SLOT(confirmClicked(bool))); connect(resetButton, SIGNAL(clicked(bool)), this, SLOT(resetClicked(bool))); }
DevSettings::DevSettings() { s = this; layout_ = new QGridLayout(); numWidgets_ = 0; addSection("Cutting"); createCheckBox("reverse cut", false); createCheckBox("mobius cut", false); addSection("Inbetweening"); createCheckBox("inverse direction", false); addSection("Rendering"); createCheckBox("draw edge orientation", false); createSpinBox("num sub", 0, 10, 2); createDoubleSpinBox("ds", 0, 10, 2); setLayout(layout_); }
void REIXSXASScanConfigurationView::setupUi() { setWindowTitle("Form"); // mono groupBox layout QFormLayout *monoGroupBoxFormLayout = new QFormLayout(); monoGroupBoxFormLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); monoGroupBoxFormLayout->setLabelAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); applyGratingBox_ = new QCheckBox("Grating"); gratingBox_ = new QComboBox(); monoGroupBoxFormLayout->setWidget(0, QFormLayout::LabelRole, applyGratingBox_); monoGroupBoxFormLayout->setWidget(0, QFormLayout::FieldRole, gratingBox_); applyMirrorBox_ = new QCheckBox("Mirror"); mirrorBox_ = new QComboBox(); monoGroupBoxFormLayout->setWidget(1, QFormLayout::LabelRole, applyMirrorBox_); monoGroupBoxFormLayout->setWidget(1, QFormLayout::FieldRole, mirrorBox_); applySlitWidthBox_ = new QCheckBox("Slit Width"); slitWidthBox_ = createDoubleSpinBox(0, -500, 500, " um", 1, 5); monoGroupBoxFormLayout->setWidget(2, QFormLayout::LabelRole, applySlitWidthBox_); monoGroupBoxFormLayout->setWidget(2, QFormLayout::FieldRole, slitWidthBox_); monoGroupBoxFormLayout->setItem(3, QFormLayout::FieldRole, new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); estimatedTimeLabel_ = new QLabel("0 s"); monoGroupBoxFormLayout->setWidget(4, QFormLayout::LabelRole, new QLabel("Estimated time:")); monoGroupBoxFormLayout->setWidget(4, QFormLayout::FieldRole, estimatedTimeLabel_); totalPointsLabel_ = new QLabel("0"); monoGroupBoxFormLayout->setWidget(5, QFormLayout::LabelRole, new QLabel("Total points:")); monoGroupBoxFormLayout->setWidget(5, QFormLayout::FieldRole, totalPointsLabel_); // polarization groupBox layout QFormLayout *polarizationGroupBoxFormLayout = new QFormLayout(); applyPolarizationBox_ = new QCheckBox("Polarization"); polarizationBox_ = new QComboBox(); polarizationGroupBoxFormLayout->setWidget(0, QFormLayout::LabelRole, applyPolarizationBox_); polarizationGroupBoxFormLayout->setWidget(0, QFormLayout::FieldRole, polarizationBox_); polarizationAngleBox_ = createDoubleSpinBox(0, -180, 180, " deg", 1, 10); polarizationGroupBoxFormLayout->setWidget(1, QFormLayout::LabelRole, new QLabel("Angle")); polarizationGroupBoxFormLayout->setWidget(1, QFormLayout::FieldRole, polarizationAngleBox_); // scan metal info layout QFormLayout *scanMetaInfoFormLayout = new QFormLayout(); scanMetaInfoFormLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); nameEdit_ = new QLineEdit(); scanMetaInfoFormLayout->setWidget(0, QFormLayout::LabelRole, new QLabel("Name")); scanMetaInfoFormLayout->setWidget(0, QFormLayout::FieldRole, nameEdit_); sampleSelector_ = new AMSamplePre2013Selector(AMDatabase::database("user")); scanMetaInfoFormLayout->setWidget(1, QFormLayout::LabelRole, new QLabel("Sample")); scanMetaInfoFormLayout->setWidget(1, QFormLayout::FieldRole, sampleSelector_); namedAutomaticallyBox_ = new QCheckBox("from current sample"); scanMetaInfoFormLayout->setWidget(2, QFormLayout::LabelRole, new QLabel("Set automatically")); scanMetaInfoFormLayout->setWidget(2, QFormLayout::FieldRole, namedAutomaticallyBox_); // layout the components topFrame_ = new AMTopFrame("Setup XAS Scan", QIcon(":/utilities-system-monitor.png")); QGroupBox *monoGroupBox = new QGroupBox("Monochromator"); monoGroupBox->setLayout(monoGroupBoxFormLayout); QGroupBox *polarizationGroupBox = new QGroupBox("Polarization"); polarizationGroupBox->setLayout(polarizationGroupBoxFormLayout); QGroupBox *scanMetaInfoGroupBox = new QGroupBox("Scan Meta-Information"); scanMetaInfoGroupBox->setLayout(scanMetaInfoFormLayout); QHBoxLayout *horizontalLayout = new QHBoxLayout(); horizontalLayout->addWidget(monoGroupBox); horizontalLayout->addItem(new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); horizontalLayout->addWidget(polarizationGroupBox); horizontalLayout->addItem(new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); horizontalLayout->addWidget(scanMetaInfoGroupBox); QVBoxLayout *innerVLayout = new QVBoxLayout(); innerVLayout->setSpacing(0); innerVLayout->setContentsMargins(12, 12, 12, 12); innerVLayout->addLayout(horizontalLayout); innerVLayout->insertWidget(0, new AMStepScanAxisView("Region Configuration", config_)); innerVLayout->addStretch(); QVBoxLayout *outerVLayout = new QVBoxLayout(); outerVLayout->insertWidget(0, topFrame_); outerVLayout->setContentsMargins(0, 0, 0, 0); outerVLayout->addLayout(innerVLayout); setLayout(outerVLayout); }
void REIXSXESSpectrometerControlEditor::setupUi() { setWindowTitle("Spectrometer"); setTitle("Spectrometer"); QFormLayout *formLayout = new QFormLayout(); formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); setLayout(formLayout); QLabel * gratingLabel = new QLabel("Grating"); gratingSelectorBox_ = new QComboBox(); formLayout->setWidget(0, QFormLayout::LabelRole, gratingLabel); formLayout->setWidget(0, QFormLayout::FieldRole, gratingSelectorBox_); gratingFeedbackLabel_ = new QLabel("Currently: LEG"); energyFeedbackLabel_ = new QLabel("at 395 e"); formLayout->setWidget(2, QFormLayout::LabelRole, gratingFeedbackLabel_); formLayout->setWidget(2, QFormLayout::FieldRole, energyFeedbackLabel_); QLabel *energyLabel = new QLabel("Energy"); energyBox_ = createDoubleSpinBox(395, 80, 2400, " eV", 4); formLayout->setWidget(3, QFormLayout::LabelRole, energyLabel); formLayout->setWidget(3, QFormLayout::FieldRole, energyBox_); QLabel *labelDefocus = new QLabel("Defocus"); defocusOffsetBox_ = createDoubleSpinBox(0, -200, 200, " mm"); formLayout->setWidget(5, QFormLayout::LabelRole, labelDefocus); formLayout->setWidget(5, QFormLayout::FieldRole, defocusOffsetBox_); QLabel *labelTiltOffset = new QLabel("Tilt Offset"); tiltOffsetBox_ = createDoubleSpinBox(0, -8, 8, " deg"); formLayout->setWidget(6, QFormLayout::LabelRole, labelTiltOffset); formLayout->setWidget(6, QFormLayout::FieldRole, tiltOffsetBox_); energyRangeLabel_ = new QLabel("361 eV - 438 eV (78eV)"); formLayout->setWidget(7, QFormLayout::FieldRole, energyRangeLabel_); stopButton_ = new QPushButton(QIcon(":/Close.png"), "Stop!"); moveNowButton_ = new QPushButton(QIcon(":/system-software-update.png"), "Move Now"); formLayout->setWidget(8, QFormLayout::LabelRole, stopButton_); formLayout->setWidget(8, QFormLayout::FieldRole, moveNowButton_); QLabel* maskLabel = new QLabel("Grating Mask"); maskComboBox_ = new QComboBox(); maskComboBox_->insertItems(0, QStringList() << "Pinhole" << "Mask" << "Out" ); formLayout->setWidget(10, QFormLayout::LabelRole, maskLabel); formLayout->setWidget(10, QFormLayout::FieldRole, maskComboBox_); maskFeedbackLabel_ = new QLabel("Currently: Unknown"); formLayout->setWidget(11, QFormLayout::FieldRole, maskFeedbackLabel_); QFont font = gratingFeedbackLabel_->font(); font.setPointSize(AM_FONT_SMALL); gratingFeedbackLabel_->setFont(font); energyFeedbackLabel_->setFont(font); }