From dd1aa117196697897dd22d96059d8c7c6d4ea80e Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 26 Feb 2020 12:56:27 +0300 Subject: [PATCH] Issue #3151: Remove extra buttons from properties dialog boxes --- src/XGUI/XGUI_ColorDialog.cpp | 2 +- src/XGUI/XGUI_DeflectionDialog.cpp | 2 +- src/XGUI/XGUI_PropertyDialog.cpp | 3 ++- src/XGUI/XGUI_Workshop.cpp | 14 ++++++-------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/XGUI/XGUI_ColorDialog.cpp b/src/XGUI/XGUI_ColorDialog.cpp index 625bc9fe4..071173173 100644 --- a/src/XGUI/XGUI_ColorDialog.cpp +++ b/src/XGUI/XGUI_ColorDialog.cpp @@ -30,7 +30,7 @@ #include XGUI_ColorDialog::XGUI_ColorDialog(QWidget* theParent) - : QDialog(theParent) + : QDialog(theParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint) { setWindowTitle(tr("Color")); QGridLayout* aLay = new QGridLayout(this); diff --git a/src/XGUI/XGUI_DeflectionDialog.cpp b/src/XGUI/XGUI_DeflectionDialog.cpp index 598d33e11..568343a74 100644 --- a/src/XGUI/XGUI_DeflectionDialog.cpp +++ b/src/XGUI/XGUI_DeflectionDialog.cpp @@ -30,7 +30,7 @@ #include XGUI_DeflectionDialog::XGUI_DeflectionDialog(QWidget* theParent) - : QDialog(theParent) + : QDialog(theParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint) { setWindowTitle(tr("Deflection")); QGridLayout* aLay = new QGridLayout(this); diff --git a/src/XGUI/XGUI_PropertyDialog.cpp b/src/XGUI/XGUI_PropertyDialog.cpp index 8e872a3d8..487c11ec5 100644 --- a/src/XGUI/XGUI_PropertyDialog.cpp +++ b/src/XGUI/XGUI_PropertyDialog.cpp @@ -25,7 +25,8 @@ #include XGUI_PropertyDialog::XGUI_PropertyDialog(QWidget* theParent) -: QDialog(theParent), myContentWidget(0) +: QDialog(theParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint), + myContentWidget(0) { myLayout = new QGridLayout(this); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 63a1c2327..6963c8426 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -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(); -- 2.39.2