[GUI] fix color gradient dialog
- large numbers as they appear of most simulations were not correctly displayed - remove non-functional help button
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>260</width>
|
<width>255</width>
|
||||||
<height>313</height>
|
<height>313</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
<property name="modal">
|
<property name="modal">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBoxModel">
|
<widget class="QGroupBox" name="groupBoxModel">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Color model</string>
|
<string>Color model</string>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint">
|
||||||
<size>
|
<size>
|
||||||
<width>3</width>
|
<width>3</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="buttonGroupStyle">
|
<widget class="QGroupBox" name="buttonGroupStyle">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Style</string>
|
<string>Style</string>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QRadioButton" name="radioButtonZero">
|
<widget class="QRadioButton" name="radioButtonZero">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Zero</string>
|
<string>&Zero</string>
|
||||||
@@ -123,10 +123,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBoxVisible">
|
<widget class="QGroupBox" name="groupBoxVisible">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Visibility</string>
|
<string>Visibility</string>
|
||||||
@@ -170,73 +170,42 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBoxRange">
|
<widget class="QGroupBox" name="groupBoxRange">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Parameter range</string>
|
<string>Parameter range</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="leftMargin">
|
<item row="0" column="0" rowspan="2">
|
||||||
<number>11</number>
|
<widget class="QLabel" name="textLabelMax">
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="topMargin">
|
<string>Ma&ximum:</string>
|
||||||
<number>11</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>11</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>11</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<layout class="QGridLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="buddy">
|
||||||
<number>0</number>
|
<cstring>floatLineEditMax</cstring>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
</widget>
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="textLabelMax">
|
|
||||||
<property name="text">
|
|
||||||
<string>Ma&ximum:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>floatLineEditMax</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="floatLineEditMax"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="textLabelMin">
|
|
||||||
<property name="text">
|
|
||||||
<string>Mi&nimum:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>floatLineEditMin</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="floatLineEditMin"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1" rowspan="2">
|
||||||
|
<widget class="QLineEdit" name="floatLineEditMax">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@@ -244,70 +213,99 @@
|
|||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint">
|
||||||
<size>
|
<size>
|
||||||
<width>35</width>
|
<width>20</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="4" rowspan="2">
|
||||||
<layout class="QGridLayout">
|
<widget class="QLabel" name="textLabel1">
|
||||||
<property name="leftMargin">
|
<property name="text">
|
||||||
<number>0</number>
|
<string>&Labels:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="buddy">
|
||||||
<number>0</number>
|
<cstring>spinBoxLabel</cstring>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
</widget>
|
||||||
<number>0</number>
|
</item>
|
||||||
|
<item row="0" column="5" rowspan="2">
|
||||||
|
<widget class="QSpinBox" name="spinBoxLabel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="alignment">
|
||||||
<number>0</number>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="textLabelMin">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mi&nimum:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>floatLineEditMin</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="floatLineEditMin">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="4">
|
||||||
|
<widget class="QLabel" name="textLabel1_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Decimals:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>spinBoxDecimals</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="5">
|
||||||
|
<widget class="QSpinBox" name="spinBoxDecimals">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<property name="value">
|
||||||
<widget class="QLabel" name="textLabel1">
|
<number>2</number>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>&Labels:</string>
|
</widget>
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>spinBoxLabel</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QSpinBox" name="spinBoxLabel"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="textLabel1_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Decimals:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>spinBoxDecimals</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QSpinBox" name="spinBoxDecimals">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
|||||||
@@ -48,13 +48,17 @@ DlgSettingsColorGradientImp::DlgSettingsColorGradientImp( QWidget* parent, Qt::W
|
|||||||
, ui(new Ui_DlgSettingsColorGradient)
|
, ui(new Ui_DlgSettingsColorGradient)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
fMaxVal = new QDoubleValidator(-1000,1000,ui->spinBoxDecimals->maximum(),this);
|
// remove the automatic help button in dialog title since we don't use it
|
||||||
ui->floatLineEditMax->setValidator(fMaxVal);
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
fMinVal = new QDoubleValidator(-1000,1000,ui->spinBoxDecimals->maximum(),this);
|
// the elementary charge is 1.6e-19, since such values might be the result of
|
||||||
ui->floatLineEditMin->setValidator(fMinVal);
|
// simulations, use this as boundary for a scientific validator
|
||||||
|
validator = new QDoubleValidator(-2e19, 2e19, ui->spinBoxDecimals->maximum(), this);
|
||||||
|
validator->setNotation(QDoubleValidator::ScientificNotation);
|
||||||
|
ui->floatLineEditMax->setValidator(validator);
|
||||||
|
ui->floatLineEditMin->setValidator(validator);
|
||||||
|
// assure that the LineEdit is as wide to contain numbers with 4 digits and 6 decimals
|
||||||
QFontMetrics fm(ui->floatLineEditMax->font());
|
QFontMetrics fm(ui->floatLineEditMax->font());
|
||||||
ui->floatLineEditMax->setMinimumWidth(QtTools::horizontalAdvance(fm, QString::fromLatin1("-1000.000000")));
|
ui->floatLineEditMax->setMinimumWidth(QtTools::horizontalAdvance(fm, QString::fromLatin1("-8000.000000")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui_DlgSettingsColorGradient> ui;
|
std::unique_ptr<Ui_DlgSettingsColorGradient> ui;
|
||||||
QDoubleValidator* fMaxVal;
|
QDoubleValidator* validator;
|
||||||
QDoubleValidator* fMinVal;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Dialog
|
} // namespace Dialog
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ bool SoFCColorGradient::customize()
|
|||||||
dlg.setRange(fMin, fMax);
|
dlg.setRange(fMin, fMax);
|
||||||
|
|
||||||
QPoint pos(QCursor::pos());
|
QPoint pos(QCursor::pos());
|
||||||
pos += QPoint((int)(-1.1*dlg.width()),(int)(-0.1*dlg.height()));
|
pos += QPoint((int)(-1.1 * dlg.width()), (int)(-0.1 * dlg.height()));
|
||||||
dlg.move( pos );
|
dlg.move( pos );
|
||||||
|
|
||||||
if (dlg.exec() == QDialog::Accepted) {
|
if (dlg.exec() == QDialog::Accepted) {
|
||||||
|
|||||||
Reference in New Issue
Block a user