From: vsv Date: Wed, 26 Feb 2020 09:56:27 +0000 (+0300) Subject: Issue #3151: Remove extra buttons from properties dialog boxes X-Git-Tag: V9_5_0a1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dd1aa117196697897dd22d96059d8c7c6d4ea80e;p=modules%2Fshaper.git Issue #3151: Remove extra buttons from properties dialog boxes --- 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();