]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #3151: Remove extra buttons from properties dialog boxes
authorvsv <vsv@opencascade.com>
Wed, 26 Feb 2020 09:56:27 +0000 (12:56 +0300)
committervsv <vsv@opencascade.com>
Wed, 26 Feb 2020 09:56:27 +0000 (12:56 +0300)
src/XGUI/XGUI_ColorDialog.cpp
src/XGUI/XGUI_DeflectionDialog.cpp
src/XGUI/XGUI_PropertyDialog.cpp
src/XGUI/XGUI_Workshop.cpp

index 625bc9fe437be7af90daa2c8cb025204bc57a86f..071173173efc9c0c16edadfc827912855284bf81 100644 (file)
@@ -30,7 +30,7 @@
 #include <QDialogButtonBox>
 
 XGUI_ColorDialog::XGUI_ColorDialog(QWidget* theParent)
-  : QDialog(theParent)
+  : QDialog(theParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint)
 {
   setWindowTitle(tr("Color"));
   QGridLayout* aLay = new QGridLayout(this);
index 598d33e11dfc782c670662daa79252ff2c670c47..568343a74367f2b02d665fb47b440307e73003a7 100644 (file)
@@ -30,7 +30,7 @@
 #include <QDialogButtonBox>
 
 XGUI_DeflectionDialog::XGUI_DeflectionDialog(QWidget* theParent)
-  : QDialog(theParent)
+  : QDialog(theParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint)
 {
   setWindowTitle(tr("Deflection"));
   QGridLayout* aLay = new QGridLayout(this);
index 8e872a3d82f345b9285f39e33e935bfd0eb68b9a..487c11ec5b0d1c70123ffb33cfd3210cb20a0aef 100644 (file)
@@ -25,7 +25,8 @@
 #include <QGridLayout>
 
 XGUI_PropertyDialog::XGUI_PropertyDialog(QWidget* theParent)
-: QDialog(theParent), myContentWidget(0)
+: QDialog(theParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint),
+  myContentWidget(0)
 {
   myLayout = new QGridLayout(this);
 
index 63a1c232707a218114a9aeb65143445d3aff8e91..6963c8426af58ed400ce5e7c7727e14205d5b445 100644 (file)
@@ -3219,9 +3219,13 @@ void XGUI_Workshop::changeIsoLines(const QObjectPtrList& theObjects)
   if (!abortAllOperations())
     return;
 
-  QDialog aDlg;
+  XGUI_PropertyDialog aDlg(desktop());
   aDlg.setWindowTitle(tr("Number of Iso-lines"));
-  QFormLayout* aLayout = new QFormLayout(&aDlg);
+
+  QWidget* aIsosWgt = new QWidget(&aDlg);
+  QFormLayout* aLayout = new QFormLayout(aIsosWgt);
+  ModuleBase_Tools::adjustMargins(aLayout);
+  aDlg.setContent(aIsosWgt);
 
   QSpinBox* aUNb = new QSpinBox(&aDlg);
   aUNb->setValue(aValues[0]);
@@ -3231,12 +3235,6 @@ void XGUI_Workshop::changeIsoLines(const QObjectPtrList& theObjects)
   aVNb->setValue(aValues[1]);
   aLayout->addRow("V:", aVNb);
 
-  QDialogButtonBox* aButtons =
-    new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &aDlg);
-  connect(aButtons, SIGNAL(accepted()), &aDlg, SLOT(accept()));
-  connect(aButtons, SIGNAL(rejected()), &aDlg, SLOT(reject()));
-  aLayout->addRow(aButtons);
-
   if (aDlg.exec() == QDialog::Accepted) {
     SessionPtr aMgr = ModelAPI_Session::get();
     QString aDescription = contextMenuMgr()->action("ISOLINES_CMD")->text();