Skip to content

Commit a65e481

Browse files
author
Charles PIGNEROL
committed
Version 6.3.0 du 06/09/23. QtCoordinatesDialog : possibilité d'afficher le domaine des composantes.
1 parent e6a73d6 commit a65e481

File tree

4 files changed

+126
-36
lines changed

4 files changed

+126
-36
lines changed

cmake/version.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#
44

55
set (QT_UTIL_MAJOR_VERSION "6")
6-
set (QT_UTIL_MINOR_VERSION "2")
7-
set (QT_UTIL_RELEASE_VERSION "1")
6+
set (QT_UTIL_MINOR_VERSION "3")
7+
set (QT_UTIL_RELEASE_VERSION "0")
88
set (QT_UTIL_VERSION ${QT_UTIL_MAJOR_VERSION}.${QT_UTIL_MINOR_VERSION}.${QT_UTIL_RELEASE_VERSION})
99

1010

src/QtUtil/QtCoordinatesDialog.cpp

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,33 @@ USE_ENCODING_AUTODETECTION
2929

3030

3131
QtCoordinatesDialog::QtCoordinatesDialog (
32-
QWidget* parent, const UTF8String& title,
33-
const UTF8String& xLabel,
34-
const UTF8String& yLabel,
35-
const UTF8String& zLabel,
36-
double x, double y, double z,
37-
bool checkboxesEnabled,
38-
bool xEnabled, bool yEnabled, bool zEnabled,
32+
QWidget* parent, const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
33+
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
3934
const string& helpURL, const string& helpTag)
4035
: QDialog (parent, QtConfiguration::modalDialogWFlags),
41-
_xTextField (0), _yTextField (0), _zTextField (0),
42-
_modifyXCheckBox (0), _modifyYCheckBox (0), _modifyZCheckBox (0),
43-
_closurePanel (0)
44-
{
36+
_xTextField (0), _yTextField (0), _zTextField (0), _modifyXCheckBox (0), _modifyYCheckBox (0), _modifyZCheckBox (0), _closurePanel (0)
37+
{
38+
createGui (title, xLabel, yLabel, zLabel, x, y, z, 1., -1., 1., -1., 1., -1., checkboxesEnabled, xEnabled, yEnabled, zEnabled, helpURL, helpTag); // v 6.3.0
39+
} // QtCoordinatesDialog::QtCoordinatesDialog
40+
41+
42+
QtCoordinatesDialog::QtCoordinatesDialog ( // v 6.3.0
43+
QWidget* parent, const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
44+
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
45+
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
46+
const string& helpURL, const string& helpTag)
47+
: QDialog (parent, QtConfiguration::modalDialogWFlags),
48+
_xTextField (0), _yTextField (0), _zTextField (0), _modifyXCheckBox (0), _modifyYCheckBox (0), _modifyZCheckBox (0), _closurePanel (0)
49+
{
50+
createGui (title, xLabel, yLabel, zLabel, x, y, z, checkboxesEnabled, xEnabled, yEnabled, zEnabled, xmin, xmax, ymin, ymax, zmin, zmax, helpURL, helpTag);
51+
} // QtCoordinatesDialog::QtCoordinatesDialog
52+
53+
54+
void QtCoordinatesDialog::createGui (const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
55+
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
56+
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
57+
const string& helpURL, const string& helpTag)
58+
{
4559
setModal (true);
4660
setWindowTitle (UTF8TOQSTRING (title));
4761

@@ -74,6 +88,16 @@ QtCoordinatesDialog::QtCoordinatesDialog (
7488
hboxLayout->addWidget (label);
7589
hboxLayout->addWidget (_xTextField);
7690
hboxLayout->addWidget (_modifyXCheckBox);
91+
if (xmax >= xmin)
92+
{ // v 6.3.0
93+
UTF8String rangeLabel;
94+
rangeLabel << "[" << xmin << ", " << xmax << "]";
95+
UTF8String tooltip = UTF8String ("Domaine : ", charset) + rangeLabel;
96+
label->setToolTip (UTF8TOQSTRING (tooltip));
97+
_xTextField->setToolTip (UTF8TOQSTRING (tooltip));
98+
label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
99+
hboxLayout->addWidget (label);
100+
} // if (xmax >= xmin)
77101

78102
// Ligne 2 : Y
79103
hbox = new QWidget (groupBox);
@@ -92,6 +116,16 @@ QtCoordinatesDialog::QtCoordinatesDialog (
92116
hboxLayout->addWidget (label);
93117
hboxLayout->addWidget (_yTextField);
94118
hboxLayout->addWidget (_modifyYCheckBox);
119+
if (ymax >= ymin)
120+
{ // v 6.3.0
121+
UTF8String rangeLabel;
122+
rangeLabel << "[" << ymin << ", " << ymax << "]";
123+
UTF8String tooltip = UTF8String ("Domaine : ", charset) + rangeLabel;
124+
label->setToolTip (UTF8TOQSTRING (tooltip));
125+
_yTextField->setToolTip (UTF8TOQSTRING (tooltip));
126+
label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
127+
hboxLayout->addWidget (label);
128+
} // if (ymax >= ymin)
95129

96130
// Ligne 3 : Y
97131
hbox = new QWidget (groupBox);
@@ -110,18 +144,30 @@ QtCoordinatesDialog::QtCoordinatesDialog (
110144
hboxLayout->addWidget (label);
111145
hboxLayout->addWidget (_zTextField);
112146
hboxLayout->addWidget (_modifyZCheckBox);
147+
if (zmax >= zmin)
148+
{ // v 6.3.0
149+
UTF8String rangeLabel;
150+
rangeLabel << "[" << zmin << ", " << zmax << "]";
151+
UTF8String tooltip = UTF8String ("Domaine : ", charset) + rangeLabel;
152+
label->setToolTip (UTF8TOQSTRING (tooltip));
153+
_zTextField->setToolTip (UTF8TOQSTRING (tooltip));
154+
label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
155+
hboxLayout->addWidget (label);
156+
} // if (zmax >= zmin)
157+
158+
int width = _xTextField->sizeHint ( ).width ( ) > _yTextField->sizeHint ( ).width ( ) ? _xTextField->sizeHint ( ).width ( ) : _yTextField->sizeHint ( ).width ( );
159+
width = _zTextField->sizeHint ( ).width ( ) > width ? _zTextField->sizeHint ( ).width ( ) : width;
160+
_xTextField->setMinimumWidth (width); // v 6.3.0
161+
_yTextField->setMinimumWidth (width); // v 6.3.0
162+
_zTextField->setMinimumWidth (width); // v 6.3.0
113163

114164
// Les boutons :
115165
layout->addWidget (new QLabel (" ", this));
116-
_closurePanel =
117-
new QtDlgClosurePanel (this, false, "Appliquer", "", "Annuler",
118-
helpURL, helpTag);
166+
_closurePanel = new QtDlgClosurePanel (this, false, "Appliquer", "", "Annuler", helpURL, helpTag);
119167
layout->addWidget (_closurePanel);
120168
_closurePanel->setMinimumSize (_closurePanel->sizeHint ( ));
121-
connect (_closurePanel->getApplyButton ( ), SIGNAL(clicked ( )), this,
122-
SLOT(accept ( )));
123-
connect (_closurePanel->getCancelButton ( ), SIGNAL(clicked ( )), this,
124-
SLOT(reject ( )));
169+
connect (_closurePanel->getApplyButton ( ), SIGNAL(clicked ( )), this, SLOT(accept ( )));
170+
connect (_closurePanel->getCancelButton ( ), SIGNAL(clicked ( )), this, SLOT(reject ( )));
125171

126172
// Par defaut le bouton OK est artificellement clique par QDialog quand
127173
// l'utilisateur fait return dans un champ de texte => on inhibe ce

src/QtUtil/public/QtUtil/QtCoordinatesDialog.h

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,47 @@ class QtCoordinatesDialog : public QDialog
2222
public :
2323

2424
/**
25-
* Constructeur. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle
26-
* aide contextuelle.
25+
* Constructeur. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle aide contextuelle.
2726
* @param Widget parent
2827
* @param Titre de la fenêtre
2928
* @param titre de la première composante.
3029
* @param titre de la seconde composante.
3130
* @param titre de la troisème composante.
3231
* @param valeurs par défaut des composantes.
33-
* @param True si les cases à cocher "active" doivent être activées,
34-
* false dans le cas contraire.
35-
* @param true si la composante est active, false dans le cas
36-
* contraire.
32+
* @param True si les cases à cocher "active" doivent être activées, false dans le cas contraire.
33+
* @param true si la composante est active, false dans le cas contraire.
3734
* @param URL de l'aide
3835
* @param Balise de l'aide
3936
* @see QtDlgClosurePanel
37+
* @see createGui
4038
*/
41-
QtCoordinatesDialog (
42-
QWidget* parent, const IN_UTIL UTF8String& title,
43-
const IN_UTIL UTF8String& xLabel,
44-
const IN_UTIL UTF8String& yLabel,
45-
const IN_UTIL UTF8String& zLabel,
46-
double x, double y, double z,
47-
bool checkboxesEnabled,
48-
bool xEnabled, bool yEnabled, bool zEnabled,
49-
const IN_STD string& helpURL = "",
50-
const IN_STD string& helpTag = "");
39+
QtCoordinatesDialog (QWidget* parent, const IN_UTIL UTF8String& title,
40+
const IN_UTIL UTF8String& xLabel, const IN_UTIL UTF8String& yLabel, const IN_UTIL UTF8String& zLabel,
41+
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
42+
const IN_STD string& helpURL = "", const IN_STD string& helpTag = "");
43+
44+
/**
45+
* Constructeur. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle aide contextuelle.
46+
* @param Widget parent
47+
* @param Titre de la fenêtre
48+
* @param titre de la première composante.
49+
* @param titre de la seconde composante.
50+
* @param titre de la troisème composante.
51+
* @param valeurs par défaut des composantes.
52+
* @param True si les cases à cocher "active" doivent être activées, false dans le cas contraire.
53+
* @param true si la composante est active, false dans le cas contraire.
54+
* @param Valeurs min et max des 3 composantes. Utilisé pour affichage informatif lorsque min <= max.
55+
* @param URL de l'aide
56+
* @param Balise de l'aide
57+
* @see QtDlgClosurePanel
58+
* @see createGui
59+
* @since 6.3.0
60+
*/
61+
QtCoordinatesDialog (QWidget* parent, const IN_UTIL UTF8String& title,
62+
const IN_UTIL UTF8String& xLabel, const IN_UTIL UTF8String& yLabel, const IN_UTIL UTF8String& zLabel,
63+
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
64+
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
65+
const IN_STD string& helpURL = "", const IN_STD string& helpTag = "");
5166

5267
/**
5368
* Destructeur : RAS.
@@ -84,6 +99,27 @@ class QtCoordinatesDialog : public QDialog
8499
* Opérateur = : interdit.
85100
*/
86101
QtCoordinatesDialog& operator = (const QtCoordinatesDialog&);
102+
103+
/**
104+
* Création de l'IHM. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle aide contextuelle.
105+
* @param Titre de la fenêtre
106+
* @param titre de la première composante.
107+
* @param titre de la seconde composante.
108+
* @param titre de la troisème composante.
109+
* @param valeurs par défaut des composantes.
110+
* @param True si les cases à cocher "active" doivent être activées, false dans le cas contraire.
111+
* @param true si la composante est active, false dans le cas contraire.
112+
* @param Valeurs min et max des 3 composantes. Utilisé pour affichage informatif lorsque min <= max.
113+
* @param URL de l'aide
114+
* @param Balise de l'aide
115+
* @see QtDlgClosurePanel
116+
* @since 6.3.0
117+
*/
118+
void createGui (const IN_UTIL UTF8String& title,
119+
const IN_UTIL UTF8String& xLabel, const IN_UTIL UTF8String& yLabel, const IN_UTIL UTF8String& zLabel,
120+
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
121+
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
122+
const IN_STD string& helpURL = "", const IN_STD string& helpTag = "");
87123

88124
/**
89125
* La saisie des composantes.

versions.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 6.3.0 : 06/09/23
2+
===============
3+
4+
QtCoordinatesDialog :
5+
- Constructeur prenant en arguments les domaines des composantes x, y, z.
6+
- M�thode createGui pour factoriser le code de construction de l'IHM.
7+
8+
19
Version 6.2.0 : 21/06/23
210
===============
311

0 commit comments

Comments
 (0)