Skip to content

Commit

Permalink
Version 6.3.0 du 06/09/23. QtCoordinatesDialog : possibilité d'affich…
Browse files Browse the repository at this point in the history
…er le domaine des composantes.
  • Loading branch information
Charles PIGNEROL committed Sep 6, 2023
1 parent e6a73d6 commit a65e481
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 36 deletions.
4 changes: 2 additions & 2 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#

set (QT_UTIL_MAJOR_VERSION "6")
set (QT_UTIL_MINOR_VERSION "2")
set (QT_UTIL_RELEASE_VERSION "1")
set (QT_UTIL_MINOR_VERSION "3")
set (QT_UTIL_RELEASE_VERSION "0")
set (QT_UTIL_VERSION ${QT_UTIL_MAJOR_VERSION}.${QT_UTIL_MINOR_VERSION}.${QT_UTIL_RELEASE_VERSION})


82 changes: 64 additions & 18 deletions src/QtUtil/QtCoordinatesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,33 @@ USE_ENCODING_AUTODETECTION


QtCoordinatesDialog::QtCoordinatesDialog (
QWidget* parent, const UTF8String& title,
const UTF8String& xLabel,
const UTF8String& yLabel,
const UTF8String& zLabel,
double x, double y, double z,
bool checkboxesEnabled,
bool xEnabled, bool yEnabled, bool zEnabled,
QWidget* parent, const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
const string& helpURL, const string& helpTag)
: QDialog (parent, QtConfiguration::modalDialogWFlags),
_xTextField (0), _yTextField (0), _zTextField (0),
_modifyXCheckBox (0), _modifyYCheckBox (0), _modifyZCheckBox (0),
_closurePanel (0)
{
_xTextField (0), _yTextField (0), _zTextField (0), _modifyXCheckBox (0), _modifyYCheckBox (0), _modifyZCheckBox (0), _closurePanel (0)
{
createGui (title, xLabel, yLabel, zLabel, x, y, z, 1., -1., 1., -1., 1., -1., checkboxesEnabled, xEnabled, yEnabled, zEnabled, helpURL, helpTag); // v 6.3.0
} // QtCoordinatesDialog::QtCoordinatesDialog


QtCoordinatesDialog::QtCoordinatesDialog ( // v 6.3.0
QWidget* parent, const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
const string& helpURL, const string& helpTag)
: QDialog (parent, QtConfiguration::modalDialogWFlags),
_xTextField (0), _yTextField (0), _zTextField (0), _modifyXCheckBox (0), _modifyYCheckBox (0), _modifyZCheckBox (0), _closurePanel (0)
{
createGui (title, xLabel, yLabel, zLabel, x, y, z, checkboxesEnabled, xEnabled, yEnabled, zEnabled, xmin, xmax, ymin, ymax, zmin, zmax, helpURL, helpTag);
} // QtCoordinatesDialog::QtCoordinatesDialog


void QtCoordinatesDialog::createGui (const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
const string& helpURL, const string& helpTag)
{
setModal (true);
setWindowTitle (UTF8TOQSTRING (title));

Expand Down Expand Up @@ -74,6 +88,16 @@ QtCoordinatesDialog::QtCoordinatesDialog (
hboxLayout->addWidget (label);
hboxLayout->addWidget (_xTextField);
hboxLayout->addWidget (_modifyXCheckBox);
if (xmax >= xmin)
{ // v 6.3.0
UTF8String rangeLabel;
rangeLabel << "[" << xmin << ", " << xmax << "]";
UTF8String tooltip = UTF8String ("Domaine : ", charset) + rangeLabel;
label->setToolTip (UTF8TOQSTRING (tooltip));
_xTextField->setToolTip (UTF8TOQSTRING (tooltip));
label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
hboxLayout->addWidget (label);
} // if (xmax >= xmin)

// Ligne 2 : Y
hbox = new QWidget (groupBox);
Expand All @@ -92,6 +116,16 @@ QtCoordinatesDialog::QtCoordinatesDialog (
hboxLayout->addWidget (label);
hboxLayout->addWidget (_yTextField);
hboxLayout->addWidget (_modifyYCheckBox);
if (ymax >= ymin)
{ // v 6.3.0
UTF8String rangeLabel;
rangeLabel << "[" << ymin << ", " << ymax << "]";
UTF8String tooltip = UTF8String ("Domaine : ", charset) + rangeLabel;
label->setToolTip (UTF8TOQSTRING (tooltip));
_yTextField->setToolTip (UTF8TOQSTRING (tooltip));
label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
hboxLayout->addWidget (label);
} // if (ymax >= ymin)

// Ligne 3 : Y
hbox = new QWidget (groupBox);
Expand All @@ -110,18 +144,30 @@ QtCoordinatesDialog::QtCoordinatesDialog (
hboxLayout->addWidget (label);
hboxLayout->addWidget (_zTextField);
hboxLayout->addWidget (_modifyZCheckBox);
if (zmax >= zmin)
{ // v 6.3.0
UTF8String rangeLabel;
rangeLabel << "[" << zmin << ", " << zmax << "]";
UTF8String tooltip = UTF8String ("Domaine : ", charset) + rangeLabel;
label->setToolTip (UTF8TOQSTRING (tooltip));
_zTextField->setToolTip (UTF8TOQSTRING (tooltip));
label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
hboxLayout->addWidget (label);
} // if (zmax >= zmin)

int width = _xTextField->sizeHint ( ).width ( ) > _yTextField->sizeHint ( ).width ( ) ? _xTextField->sizeHint ( ).width ( ) : _yTextField->sizeHint ( ).width ( );
width = _zTextField->sizeHint ( ).width ( ) > width ? _zTextField->sizeHint ( ).width ( ) : width;
_xTextField->setMinimumWidth (width); // v 6.3.0
_yTextField->setMinimumWidth (width); // v 6.3.0
_zTextField->setMinimumWidth (width); // v 6.3.0

// Les boutons :
layout->addWidget (new QLabel (" ", this));
_closurePanel =
new QtDlgClosurePanel (this, false, "Appliquer", "", "Annuler",
helpURL, helpTag);
_closurePanel = new QtDlgClosurePanel (this, false, "Appliquer", "", "Annuler", helpURL, helpTag);
layout->addWidget (_closurePanel);
_closurePanel->setMinimumSize (_closurePanel->sizeHint ( ));
connect (_closurePanel->getApplyButton ( ), SIGNAL(clicked ( )), this,
SLOT(accept ( )));
connect (_closurePanel->getCancelButton ( ), SIGNAL(clicked ( )), this,
SLOT(reject ( )));
connect (_closurePanel->getApplyButton ( ), SIGNAL(clicked ( )), this, SLOT(accept ( )));
connect (_closurePanel->getCancelButton ( ), SIGNAL(clicked ( )), this, SLOT(reject ( )));

// Par defaut le bouton OK est artificellement clique par QDialog quand
// l'utilisateur fait return dans un champ de texte => on inhibe ce
Expand Down
68 changes: 52 additions & 16 deletions src/QtUtil/public/QtUtil/QtCoordinatesDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,47 @@ class QtCoordinatesDialog : public QDialog
public :

/**
* Constructeur. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle
* aide contextuelle.
* Constructeur. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle aide contextuelle.
* @param Widget parent
* @param Titre de la fenêtre
* @param titre de la première composante.
* @param titre de la seconde composante.
* @param titre de la troisème composante.
* @param valeurs par défaut des composantes.
* @param True si les cases à cocher "active" doivent être activées,
* false dans le cas contraire.
* @param true si la composante est active, false dans le cas
* contraire.
* @param True si les cases à cocher "active" doivent être activées, false dans le cas contraire.
* @param true si la composante est active, false dans le cas contraire.
* @param URL de l'aide
* @param Balise de l'aide
* @see QtDlgClosurePanel
* @see createGui
*/
QtCoordinatesDialog (
QWidget* parent, const IN_UTIL UTF8String& title,
const IN_UTIL UTF8String& xLabel,
const IN_UTIL UTF8String& yLabel,
const IN_UTIL UTF8String& zLabel,
double x, double y, double z,
bool checkboxesEnabled,
bool xEnabled, bool yEnabled, bool zEnabled,
const IN_STD string& helpURL = "",
const IN_STD string& helpTag = "");
QtCoordinatesDialog (QWidget* parent, const IN_UTIL UTF8String& title,
const IN_UTIL UTF8String& xLabel, const IN_UTIL UTF8String& yLabel, const IN_UTIL UTF8String& zLabel,
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
const IN_STD string& helpURL = "", const IN_STD string& helpTag = "");

/**
* Constructeur. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle aide contextuelle.
* @param Widget parent
* @param Titre de la fenêtre
* @param titre de la première composante.
* @param titre de la seconde composante.
* @param titre de la troisème composante.
* @param valeurs par défaut des composantes.
* @param True si les cases à cocher "active" doivent être activées, false dans le cas contraire.
* @param true si la composante est active, false dans le cas contraire.
* @param Valeurs min et max des 3 composantes. Utilisé pour affichage informatif lorsque min <= max.
* @param URL de l'aide
* @param Balise de l'aide
* @see QtDlgClosurePanel
* @see createGui
* @since 6.3.0
*/
QtCoordinatesDialog (QWidget* parent, const IN_UTIL UTF8String& title,
const IN_UTIL UTF8String& xLabel, const IN_UTIL UTF8String& yLabel, const IN_UTIL UTF8String& zLabel,
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
const IN_STD string& helpURL = "", const IN_STD string& helpTag = "");

/**
* Destructeur : RAS.
Expand Down Expand Up @@ -84,6 +99,27 @@ class QtCoordinatesDialog : public QDialog
* Opérateur = : interdit.
*/
QtCoordinatesDialog& operator = (const QtCoordinatesDialog&);

/**
* Création de l'IHM. Délègue à la classe <I>QtDlgClosurePanel</I> l'éventuelle aide contextuelle.
* @param Titre de la fenêtre
* @param titre de la première composante.
* @param titre de la seconde composante.
* @param titre de la troisème composante.
* @param valeurs par défaut des composantes.
* @param True si les cases à cocher "active" doivent être activées, false dans le cas contraire.
* @param true si la composante est active, false dans le cas contraire.
* @param Valeurs min et max des 3 composantes. Utilisé pour affichage informatif lorsque min <= max.
* @param URL de l'aide
* @param Balise de l'aide
* @see QtDlgClosurePanel
* @since 6.3.0
*/
void createGui (const IN_UTIL UTF8String& title,
const IN_UTIL UTF8String& xLabel, const IN_UTIL UTF8String& yLabel, const IN_UTIL UTF8String& zLabel,
double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
const IN_STD string& helpURL = "", const IN_STD string& helpTag = "");

/**
* La saisie des composantes.
Expand Down
8 changes: 8 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Version 6.3.0 : 06/09/23
===============

QtCoordinatesDialog :
- Constructeur prenant en arguments les domaines des composantes x, y, z.
- M�thode createGui pour factoriser le code de construction de l'IHM.


Version 6.2.0 : 21/06/23
===============

Expand Down

0 comments on commit a65e481

Please sign in to comment.