/*protected*/ void ReporterItemPanel::makeDndIconPanel(QHash<QString, NamedIcon*>* /*iconMap*/, QString /*displayKey*/) { if (_update) { return; } _reporter = new ReporterIcon(_editor); QGroupBox* panel = new QGroupBox(); QString borderName = tr("Drag to Panel"); QString gbStyleSheet = "QGroupBox { border: 2px solid gray; border-radius: 3px;} QGroupBox::title { /*background-color: transparent;*/ subcontrol-position: top left; /* position at the top left*/ padding:0 0px;} "; panel->setLayout(new QHBoxLayout); panel->setTitle(borderName); panel->setStyleSheet(gbStyleSheet); QWidget* comp; DataFlavor* flavor; try { //comp = getDragger(flavor = new DataFlavor(Editor::POSITIONABLE_FLAVOR)); comp = getDragger(flavor = new DataFlavor(_reporter,"ReporterIcon")); flavor->setMimeTypeParameter("reporter", _reporter->getName()); comp->setToolTip(tr("Drag an icon from this panel to add it to the control panel")); } catch (ClassNotFoundException cnfe) { //cnfe.printStackTrace(); comp = new QWidget(); } comp->setLayout(new FlowLayout); comp->layout()->addWidget(_reporter); panel->layout()->addWidget(comp); //panel.validate(); int width = qMax(100, panel->sizeHint().width()); panel->setMinimumSize( QSize(width, panel->minimumSize().height())); panel->setToolTip(tr("Drag an icon from this panel to add it to the control panel")); _dragIconPanel->layout()->addWidget( panel); _dragIconPanel->setToolTip(tr("Drag an icon from this panel to add it to the control panel")); }
nxtRicWordRectValue::nxtRicWordRectValue( QString name, QString tooltip, QWidget *parent ): nxtVarEditAbstract( parent ), control_x( this, tr("X"), NULL, "" ), control_y( this, tr("Y"), NULL, "" ), control_width( this, tr("Width"), NULL, "" ), control_height( this, tr("Height"), NULL, "" ) { //Create the groupbox QGroupBox *gbox = new QGroupBox( name, this ); gbox->setToolTip( tooltip ); //Set up layouts QVBoxLayout *mainlayout = new QVBoxLayout; QVBoxLayout *boxlayout = new QVBoxLayout; setLayout( mainlayout ); gbox->setLayout( boxlayout ); mainlayout->addWidget( gbox ); mainlayout->setContentsMargins( QMargins() ); //Add ric_value controls boxlayout->addWidget( (QWidget*)&control_x ); boxlayout->addWidget( (QWidget*)&control_y ); boxlayout->addWidget( (QWidget*)&control_width ); boxlayout->addWidget( (QWidget*)&control_height ); connect( &control_x, SIGNAL( value_changed() ), this, SIGNAL( value_changed() ) ); connect( &control_y, SIGNAL( value_changed() ), this, SIGNAL( value_changed() ) ); connect( &control_width, SIGNAL( value_changed() ), this, SIGNAL( value_changed() ) ); connect( &control_height, SIGNAL( value_changed() ), this, SIGNAL( value_changed() ) ); }
QWidget* USAcqusitionWidget::wrapGroupBox(QWidget* input, QString name, QString tip) { QGroupBox* retval = new QGroupBox(name); retval->setToolTip(tip); QVBoxLayout* layout = new QVBoxLayout(retval); layout->addWidget(input); layout->addStretch(); layout->setMargin(layout->margin()/2); return retval; }
void ClippingWidget::setupUI() { if (mInteractiveClipper) return; mInteractiveClipper.reset(new InteractiveClipper(mServices)); if (!mInteractiveClipper) return; connect(mInteractiveClipper.get(), SIGNAL(changed()), this, SLOT(clipperChangedSlot())); mDataAdapter = StringPropertySelectData::New(mServices->patient()); LabeledComboBoxWidget* imageCombo = new LabeledComboBoxWidget(this, mDataAdapter); connect(mDataAdapter.get(), SIGNAL(changed()), this, SLOT(imageChangedSlot())); this->setToolTip("Interactive volume clipping"); QVBoxLayout* layout = new QVBoxLayout(this); QGroupBox* activeClipGroupBox = new QGroupBox("Interactive clipper"); activeClipGroupBox->setToolTip(this->toolTip()); layout->addWidget(activeClipGroupBox); QVBoxLayout* activeClipLayout = new QVBoxLayout(activeClipGroupBox); mPlaneAdapter = StringPropertyClipPlane::New(mInteractiveClipper); LabeledComboBoxWidget* combo = new LabeledComboBoxWidget(this, mPlaneAdapter); mUseClipperCheckBox = new QCheckBox("Use Clipper"); mUseClipperCheckBox->setToolTip("Turn on interactive clipping for the selected volume."); connect(mUseClipperCheckBox, SIGNAL(toggled(bool)), mInteractiveClipper.get(), SLOT(useClipper(bool))); activeClipLayout->addWidget(mUseClipperCheckBox); activeClipLayout->addWidget(imageCombo); activeClipLayout->addWidget(combo); mInvertPlaneCheckBox = new QCheckBox("Invert plane"); mInvertPlaneCheckBox->setToolTip("Use the inverse (mirror) of the selected slice plane."); connect(mInvertPlaneCheckBox, SIGNAL(toggled(bool)), mInteractiveClipper.get(), SLOT(invertPlane(bool))); activeClipLayout->addWidget(mInvertPlaneCheckBox); QPushButton* saveButton = new QPushButton("Save clip plane"); saveButton->setToolTip("Save the interactive plane as a clip plane in the selected volume."); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveButtonClickedSlot())); //saveButton->setEnabled(false); QPushButton* clearButton = new QPushButton("Clear saved planes"); clearButton->setToolTip("Remove all saved clip planes from the selected volume"); connect(clearButton, SIGNAL(clicked()), this, SLOT(clearButtonClickedSlot())); //clearButton->setEnabled(false); activeClipLayout->addWidget(saveButton); layout->addWidget(clearButton); layout->addStretch(); this->clipperChangedSlot(); }
void ConfigObjectDialog::addGroup(QLayout* parentLayout, string title, string toolTip, QLayout *groupLayout) { QGroupBox* group = new QGroupBox(); group->setLayout(groupLayout); group->setTitle(QString().fromUtf8(title.c_str())); group->setToolTip(toolTip.c_str()); if (!groupLayout->isEmpty()) { parentLayout->addWidget(group); } else { group->deleteLater(); } }
startPage::startPage (QWidget *parent, QString parameter_file, PFM_GLOBAL *pfm_glb): QWizardPage (parent) { pfm_global = pfm_glb; setPixmap (QWizard::WatermarkPixmap, QPixmap(":/icons/pfmLoadWatermark.png")); setTitle (tr ("Introduction")); setWhatsThis (tr ("See, it really works!")); QLabel *label = new QLabel (tr ("The pfmLoad program is used to create or append to PFM structures. Context " "sensitive help is available by clicking on the Help button and then clicking, with the " "Question Arrow cursor, on the field of interest. You can preload a previously saved " "parameters file (*.prm) by placing it on the command line. Press <b>Next</b> to go to the " "first PFM definition page.<br><br>" "<b><i>IMPORTANT NOTE</i>: You may load up to 30 PFM structures in one run. This only makes " "sense if all of the PFM areas contain data from the same set of input files. " "Otherwise the program will be checking every data point against every PFM area " "bounds definition and you will be wasting lots of time.</b><br><br>" "<b><i>OTHER IMPORTANT NOTE</i>: You may save the parameters entered into this wizard to a " "new or preexisting parameter file. There are two types of parameter files. The normal " "parameter file (.prm) which can be used on the command line for pfmLoad or pfmLoader, " "or an <i>update</i> parameter file (.upr) that can only be used as a command line argument " "to pfmLoader. The <i>update</i> parameter file (.upr) can only be created if you use the " "<i>Directories->Browse</i> button on the <i>Input Data Files</i> page. For more information " "on why you would want to do this, use the <i>What's This</i> help on the <i>Save</i> button " "on the <i>Build PFM Structure(s)</i> page of this wizard.")); label->setWordWrap(true); QVBoxLayout *vbox = new QVBoxLayout (this); vbox->addWidget (label); vbox->addStretch (10); QGroupBox *prmBox = new QGroupBox (this); prmBox->setWhatsThis (tr ("This box will show the name of the parameter file that was placed on the command line. ") + tr ("If no command was placed on the command line it will say <b>No command line parameter file</b>")); prmBox->setToolTip (tr ("Parameter file from command line (if present)")); QHBoxLayout *prmBoxLayout = new QHBoxLayout; prmBoxLayout->setSpacing (5); prmBox->setLayout (prmBoxLayout); QLabel *prmlbl = new QLabel (this); prmlbl->setWhatsThis (tr ("This box will show the name of the parameter file that was placed on the command line. ") + tr ("If no command was placed on the command line it will say <b>No command line parameter file</b>")); prmlbl->setToolTip (tr ("Parameter file from command line (if present)")); if (!parameter_file.isEmpty ()) { prmlbl->setText (tr ("Command line parameter file: <b>") + parameter_file + "</b>"); } else { prmlbl->setText (tr ("No command line parameter file")); } prmBoxLayout->addWidget (prmlbl); vbox->addWidget (prmBox); QGroupBox *memBox = new QGroupBox (tr ("Cache memory"), this); QHBoxLayout *memBoxLayout = new QHBoxLayout; memBox->setLayout (memBoxLayout); memBoxLayout->setSpacing (10); // Had to do this as a QDoubleSpinBox because QSpinBox won't do no-wrap if the top end might exceed // a 32 bit signed integer max value. mem = new QDoubleSpinBox (memBox); mem->setRange (200000000.0, 2147483647.0); mem->setSingleStep (100000000.0); mem->setDecimals (0.0); mem->setValue ((NV_FLOAT64) pfm_global->cache_mem); mem->setWrapping (FALSE); mem->setToolTip (tr ("Set the amount of cache memory for each PFM to be loaded")); mem->setWhatsThis (tr ("Set the amount of cache memory used for each PFM file to be created or appended to. ") + tr ("The value is in bytes and ranges from a minimum of 200,000,000 up to 2,147,483,647. The default is ") + tr ("400,000,000. If you set this to a large value (like 2,147,483,647) and you have a limited amount of ") + tr ("memory and a large number of PFMs to be built you will end up using swap space and your ") + tr ("build will be extremely slow ;-)")); memBoxLayout->addWidget (mem); vbox->addWidget (memBox); registerField ("mem", mem, "value"); }