55#include " QtUtil/QtMessageBox.h"
66
77#include < TkUtil/Exception.h>
8+ #include < TkUtil/NumericServices.h>
89
910#include < QValidator>
10- #ifndef QT_5
11- #include < QtGui/QLabel>
12- #include < QtGui/QMessageBox>
13- #include < QtGui/QHBoxLayout>
14- #else // QT_5
1511#include < QLabel>
1612#include < QMessageBox>
1713#include < QHBoxLayout>
18- #endif // QT_5
1914
2015#include < assert.h>
2116
@@ -35,7 +30,8 @@ QtCoordinatesDialog::QtCoordinatesDialog (
3530 : QDialog (parent, QtConfiguration::modalDialogWFlags),
3631 _xTextField (0 ), _yTextField (0 ), _zTextField (0 ), _modifyXCheckBox (0 ), _modifyYCheckBox (0 ), _modifyZCheckBox (0 ), _closurePanel (0 )
3732{
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
33+ // createGui (title, xLabel, yLabel, zLabel, x, y, z, 1., -1., 1., -1., 1., -1., checkboxesEnabled, xEnabled, yEnabled, zEnabled, helpURL, helpTag); // v 6.3.0
34+ createGui (title, xLabel, yLabel, zLabel, x, y, z, checkboxesEnabled, xEnabled, yEnabled, zEnabled, -NumericServices::doubleMachMax ( ), NumericServices::doubleMachMax ( ), -NumericServices::doubleMachMax ( ), NumericServices::doubleMachMax ( ), -NumericServices::doubleMachMax ( ), NumericServices::doubleMachMax ( ), helpURL, helpTag);
3935} // QtCoordinatesDialog::QtCoordinatesDialog
4036
4137
@@ -61,20 +57,33 @@ void QtCoordinatesDialog::createGui (const UTF8String& title, const UTF8String&
6157
6258 // Creation de l'ihm :
6359 QVBoxLayout* layout = new QVBoxLayout (this );
60+ #ifdef QT_5
6461 layout->setMargin (QtConfiguration::margin);
62+ #else // => Qt6
63+ layout->setContentsMargins (QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin);
64+ #endif // QT_5
6565 layout->setSizeConstraint (QLayout::SetMinimumSize);
66-
66+
6767 // Le panneau :
6868 QtGroupBox* groupBox = new QtGroupBox (" Composantes" , this );
6969 groupBox->setSpacing (QtConfiguration::spacing);
70+ #ifdef QT_5
7071 groupBox->setMargin (QtConfiguration::margin);
72+ #else // => Qt6
73+ groupBox->setContentsMargins (QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin);
74+ #endif // QT_5
75+
7176 layout->addWidget (groupBox);
7277 QVBoxLayout* coordsLayout = new QVBoxLayout (groupBox);
7378 groupBox->setLayout (coordsLayout);
7479 // Ligne 1 : X
7580 QWidget* hbox = new QWidget (groupBox);
7681 QHBoxLayout* hboxLayout = new QHBoxLayout ( );
82+ #ifdef QT_5
7783 hboxLayout->setMargin (QtConfiguration::margin);
84+ #else // => Qt6
85+ hboxLayout->setContentsMargins (QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin);
86+ #endif // QT_5
7887 hboxLayout->setSpacing (QtConfiguration::spacing);
7988 hbox->setLayout (hboxLayout);
8089 coordsLayout->addWidget (hbox);
@@ -102,7 +111,11 @@ void QtCoordinatesDialog::createGui (const UTF8String& title, const UTF8String&
102111 // Ligne 2 : Y
103112 hbox = new QWidget (groupBox);
104113 hboxLayout = new QHBoxLayout ( );
114+ #ifdef QT_5
105115 hboxLayout->setMargin (QtConfiguration::margin);
116+ #else // => Qt6
117+ hboxLayout->setContentsMargins (QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin);
118+ #endif // QT_5
106119 hboxLayout->setSpacing (QtConfiguration::spacing);
107120 hbox->setLayout (hboxLayout);
108121 coordsLayout->addWidget (hbox);
@@ -130,7 +143,11 @@ void QtCoordinatesDialog::createGui (const UTF8String& title, const UTF8String&
130143 // Ligne 3 : Y
131144 hbox = new QWidget (groupBox);
132145 hboxLayout = new QHBoxLayout ( );
146+ #ifdef QT_5
133147 hboxLayout->setMargin (QtConfiguration::margin);
148+ #else // => Qt6
149+ hboxLayout->setContentsMargins (QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin, QtConfiguration::margin);
150+ #endif // QT_5
134151 hboxLayout->setSpacing (QtConfiguration::spacing);
135152 hbox->setLayout (hboxLayout);
136153 coordsLayout->addWidget (hbox);
@@ -205,6 +222,7 @@ void QtCoordinatesDialog::getCoordinates (double& x, double& y, double& z) const
205222 assert (0 != _xTextField);
206223 assert (0 != _yTextField);
207224 assert (0 != _zTextField);
225+
208226 bool xOk = true , yOk = true , zOk = true ;
209227 x = _xTextField->text ( ).toDouble (&xOk);
210228 y = _yTextField->text ( ).toDouble (&yOk);
0 commit comments