Class that manages the widgets inside a QDockWidget. More...
#include <DockWindowManager.h>
Public Member Functions | |
QDockWidget * | addDockWindow (const char *name, QWidget *widget, Qt::DockWidgetArea pos=Qt::AllDockWidgetAreas) |
Adds a QDockWidget to the main window and sets widget as its widget. More... | |
QWidget * | getDockWindow (const char *name) const |
Returns the widget with name name added with addDockWindow. More... | |
QList< QWidget * > | getDockWindows () const |
Returns a list of all widgets which set to a QDockWidget. More... | |
Static Public Member Functions | |
static void | destruct () |
static DockWindowManager * | instance () |
Creates the only instance of the DockWindowManager. More... | |
without deleting it. | |
bool | registerDockWindow (const char *name, QWidget *widget) |
Appends a new widget with name to the list of available dock widgets. More... | |
QWidget * | unregisterDockWindow (const char *name) |
void | setup (DockWindowItems *) |
Sets up the dock windows of the activated workbench. More... | |
QWidget * | removeDockWindow (const char *name) |
Removes and destroys the QDockWidget and returns the widget with name name added with addDockWindow. More... | |
void | removeDockWindow (QWidget *dock) |
Removes and destroys the QDockWidget that contains dock. More... | |
void | saveState () |
void | retranslate () |
Sets the window title for the dockable windows. More... | |
Detailed Description
Class that manages the widgets inside a QDockWidget.
Member Function Documentation
◆ addDockWindow()
QDockWidget * DockWindowManager::addDockWindow | ( | const char * | name, |
QWidget * | widget, | ||
Qt::DockWidgetArea | pos = Qt::AllDockWidgetAreas |
||
) |
Adds a QDockWidget to the main window and sets widget as its widget.
Adds a new dock window to the main window and embeds the given widget.
References Gui::getMainWindow().
Referenced by Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), Gui::Dialog::DockablePlacement::DockablePlacement(), MeshGui::DockEvaluateMeshImp::DockEvaluateMeshImp(), and setup().
◆ destruct()
|
static |
Referenced by Gui::WorkbenchManager::~WorkbenchManager().
◆ getDockWindow()
QWidget * DockWindowManager::getDockWindow | ( | const char * | name | ) | const |
Returns the widget with name name added with addDockWindow.
Returns the widget inside the dock window by name.
- Note
- The returned widget is not the QDockWidget instance returned from addDockWindow. If you want to access the QDockWidget you get it with parentWidget() of the returned widget.
If it does not exist 0 is returned.
Referenced by Gui::Dialog::DlgGeneralImp::saveSettings(), and Gui::ControlSingleton::showDialog().
◆ getDockWindows()
QList< QWidget * > DockWindowManager::getDockWindows | ( | ) | const |
Returns a list of all widgets which set to a QDockWidget.
Returns a list of all widgets inside the dock windows.
◆ instance()
|
static |
Creates the only instance of the DockWindowManager.
Referenced by Gui::Dialog::DockablePlacement::accept(), Gui::Workbench::activate(), Gui::ControlSingleton::closeDialog(), MeshGui::DockEvaluateMeshImp::closeEvent(), Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), Gui::Dialog::DockablePlacement::DockablePlacement(), MeshGui::DockEvaluateMeshImp::DockEvaluateMeshImp(), Gui::MainWindow::MainWindow(), Gui::Dialog::DlgDisplayPropertiesImp::reject(), Gui::Dialog::DockablePlacement::reject(), Gui::Workbench::retranslate(), Gui::Dialog::DlgGeneralImp::saveSettings(), Gui::MainWindow::saveWindowSettings(), Gui::ControlSingleton::showDialog(), Gui::ControlSingleton::showModelView(), Gui::ControlSingleton::showTaskView(), Gui::ControlSingleton::tabPanel(), Gui::ControlSingleton::taskPanel(), and SandboxGui::Workbench::Workbench().
◆ registerDockWindow()
Appends a new widget with name to the list of available dock widgets.
The caller must make sure that the name is unique. If a widget with this name is already registered nothing is done but false is returned, otherwise it is appended and true is returned.
As default the following widgets are already registered:
- Std_TreeView
- Std_PropertyView
- Std_ReportView
- Std_ToolBox
- Std_ComboView
- Std_SelectionView
To avoid name clashes the caller should use names of the form module_widgettype, i. e. if a analyse dialog for the mesh module is added the name must then be Mesh_AnalyzeDialog.
To make use of dock windows when a workbench gets loaded the method setupDockWindows() must reimplemented in a subclass of Gui::Workbench.
Referenced by Gui::MainWindow::MainWindow(), and SandboxGui::Workbench::Workbench().
◆ removeDockWindow() [1/2]
QWidget * DockWindowManager::removeDockWindow | ( | const char * | name | ) |
Removes and destroys the QDockWidget and returns the widget with name name added with addDockWindow.
References Gui::getMainWindow().
Referenced by Gui::Dialog::DockablePlacement::accept(), MeshGui::DockEvaluateMeshImp::closeEvent(), Gui::Dialog::DlgDisplayPropertiesImp::reject(), and Gui::Dialog::DockablePlacement::reject().
◆ removeDockWindow() [2/2]
void DockWindowManager::removeDockWindow | ( | QWidget * | widget | ) |
Removes and destroys the QDockWidget that contains dock.
Method provided for convenience.
dock does not get destroyed.
Does basically the same as the method above unless that it accepts a pointer.
References Gui::getMainWindow().
◆ retranslate()
void DockWindowManager::retranslate | ( | ) |
Sets the window title for the dockable windows.
Referenced by Gui::Workbench::retranslate().
◆ saveState()
void DockWindowManager::saveState | ( | ) |
References App::GetApplication(), ParameterGrp::GetGroup(), App::Application::GetUserParameter(), and ParameterGrp::SetBool().
Referenced by Gui::MainWindow::saveWindowSettings(), and setup().
◆ setup()
void DockWindowManager::setup | ( | DockWindowItems * | items | ) |
Sets up the dock windows of the activated workbench.
References addDockWindow(), App::GetApplication(), ParameterGrp::GetBool(), ParameterGrp::GetGroup(), Gui::getMainWindow(), App::Application::GetUserParameter(), saveState(), and ParameterGrp::SetBool().
Referenced by Gui::Workbench::activate(), PathScripts.PathDressupHoldingTags.ObjectTagDressup::doExecute(), PathScripts.PathDressupDogbone.ObjectDressup::execute(), PathScripts.PathDressupHoldingTags.ObjectTagDressup::generateTags(), PathScripts.PathDressupHoldingTags.ObjectTagDressup::pointAtBottom(), PathScripts.PathDressupHoldingTags.ObjectTagDressup::pointIsOnPath(), PathScripts.PathDressupHoldingTags.ObjectTagDressup::setXyEnabled(), and PathScripts.PathDressupHoldingTags.ObjectTagDressup::supportsTagGeneration().
◆ unregisterDockWindow()
QWidget * DockWindowManager::unregisterDockWindow | ( | const char * | name | ) |
The documentation for this class was generated from the following files:
- src/Gui/DockWindowManager.h
- src/Gui/DockWindowManager.cpp