Configuration For Measures Between Two Elements.
More...
#include <qgmatrixmeasuredlg.h>
|
Ui_QGMatrixMeasureDlg * | Ui |
|
Configuration For Measures Between Two Elements.
Generic dialog box to configure a measure between two elements. A plug-in must be created with the GMatrixMeasure class.
{
dlg.Configure(params);
}
Construct the dialog box.
- Parameters
-
title | Title of the dialog box. |
QWidget* GetMeasureSpecific |
( |
void |
| ) |
|
Get a pointer to the group box holding the specific part.
QVBoxLayout* GetMeasureSpecificLayout |
( |
void |
| ) |
|
Get a pointer to the group box's layout holding the specific part.
Launch the configuration.
- Parameters
-
virtual void Panel |
( |
void |
| ) |
|
|
virtual |
Method called before the dialog box is initialized. By default, it hides the groupbox 'MesureSpecific' reserved for specific parameters for the measures.
This method can be override to add new widgets. The methods 'Init' and 'Done' must be overwritten to link these widgets to parameters of the plug-in.
void MyDlg::Panel(void)
{
QHBoxLayout* layout = new QHBoxLayout(0,0,6);
text->setText("Minimum common documents");
layout->addWidget(text);
layout->addItem(new QSpacerItem(140,20,QSizePolicy::Expanding, QSizePolicy::Minimum));
MinDocs = new QSpinBox(MeasureSpecific,"MinDocs");
layout->addWidget(MinDoc);
}
virtual void Init |
( |
GPlugIn * |
plugin | ) |
|
|
virtual |
Method called before the dialog box is opened. It uses the values of the parameters to initialize the dialog box. This method can be override (normally with the 'Panel' and 'Done' methods) to synchronized new parameters and widgets.
void MyDlg::Init(GPlugIn* plugin)
{
MinDocs->setValue(plugin->FindParam<RParamValue>("MinDocs")->GetUInt);
}
- Parameters
-
virtual void Done |
( |
GPlugIn * |
plugin | ) |
|
|
virtual |
Method called when the dialog box is closed with the 'OK' button. The parameters are set based on the value of the dialog box. This method can be overridden (normally with the 'Panel' and 'Init' methods) to synchronized new parameters and widgets.
void MyDlg::Done(GPlugIn* plugin)
{
plugin->FindParam<RParamValue>("MinDocs")->SetUInt(MinDocs->value());
}
- Parameters
-
virtual bool IsDlgOK |
( |
void |
| ) |
|
|
virtual |
This method should check if the parameters of the dialog box are acceptable. Eventually, it should show a error message.
- Returns
- true if the dialog box can be applied.
void ChangeType |
( |
int |
type | ) |
|
|
slot |
Change type of the measure.
- Parameters
-
Apply the dialog box if its values are OK.
Ui_QGMatrixMeasureDlg* Ui |
|
private |
Pointer to the widget created by Qt.