From 583f262a90ef72931e77c63fc7d5d05be2d336c7 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 21 Apr 2016 18:18:52 +0300 Subject: [PATCH] Issue #1427: set header of modal dialog box --- src/ModuleBase/ModuleBase_Dialog.cpp | 6 ++++++ src/ModuleBase/ModuleBase_WidgetFactory.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/ModuleBase/ModuleBase_Dialog.cpp b/src/ModuleBase/ModuleBase_Dialog.cpp index 0ac6a72b1..67e374280 100644 --- a/src/ModuleBase/ModuleBase_Dialog.cpp +++ b/src/ModuleBase/ModuleBase_Dialog.cpp @@ -11,6 +11,9 @@ #include #include +#include +#include + #include #include #include @@ -26,6 +29,9 @@ ModuleBase_Dialog::ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QStr myActiveWidget(0) { ModuleBase_WidgetFactory aFactory(myDescription, myWorkshop); + std::string aTitle = aFactory.widgetAPI()->getProperty(FEATURE_TEXT); + + setWindowTitle(aTitle.c_str()); SessionPtr aMgr = ModelAPI_Session::get(); std::shared_ptr aDoc = aMgr->activeDocument(); diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.h b/src/ModuleBase/ModuleBase_WidgetFactory.h index b8ae7b465..8fddaa4dd 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.h +++ b/src/ModuleBase/ModuleBase_WidgetFactory.h @@ -68,6 +68,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFactory /// \param theAttributeId an outpup parameter with attribute void getGreedAttribute(std::string& theAttributeId); + /// Returns widget API from XML + const Config_WidgetAPI* widgetAPI() const { return myWidgetApi; } + protected: /// check if ModuleBase_Widget has expandable widgets in getControls bool hasExpandingControls(QWidget* theParent); -- 2.39.2