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. | |
Removes the specified dock window with name | |
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 | activate (QWidget *widget) |
If the corresponding dock widget isn't visible then activate it. More... | |
void | saveState () |
void | loadState () |
void | retranslate () |
Sets the window title for the dockable windows. More... | |
Class that manages the widgets inside a QDockWidget.
void DockWindowManager::activate | ( | QWidget * | widget | ) |
If the corresponding dock widget isn't visible then activate it.
Referenced by ArchBuildingPart.ViewProviderBuildingPart::doubleClicked(), draftviewproviders.view_layer.ViewProviderLayer::setupContextMenu(), and Gui::DockWnd::ReportOutputObserver::showReportView().
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 draftgeoutils.intersections::connect(), and Gui::getMainWindow().
Referenced by Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), Gui::Dialog::DockablePlacement::DockablePlacement(), MeshGui::DockEvaluateMeshImp::DockEvaluateMeshImp(), Gui::Dialog::Clipping::makeDockWidget(), PartGui::SectionCut::makeDockWidget(), and setup().
|
static |
Referenced by Gui::WorkbenchManager::~WorkbenchManager().
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.
If it does not exist 0 is returned.
Referenced by Gui::ControlSingleton::showDialog().
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.
|
static |
Creates the only instance of the DockWindowManager.
Referenced by Gui::Dialog::DockablePlacement::accept(), Gui::Workbench::activate(), Gui::PreferencePackManager::apply(), Gui::ControlSingleton::closeDialog(), MeshGui::DockEvaluateMeshImp::closeEvent(), Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), Gui::Dialog::DockablePlacement::DockablePlacement(), MeshGui::DockEvaluateMeshImp::DockEvaluateMeshImp(), Gui::MainWindow::MainWindow(), Gui::Dialog::Clipping::makeDockWidget(), PartGui::SectionCut::makeDockWidget(), Gui::Dialog::DlgDisplayPropertiesImp::reject(), Gui::Dialog::DockablePlacement::reject(), Gui::Workbench::retranslate(), Gui::MainWindow::saveWindowSettings(), Gui::ControlSingleton::showDialog(), Gui::ControlSingleton::showModelView(), Gui::DockWnd::ReportOutputObserver::showReportView(), Gui::ControlSingleton::showTaskView(), Gui::ControlSingleton::tabPanel(), Gui::ControlSingleton::taskPanel(), and SandboxGui::Workbench::Workbench().
void DockWindowManager::loadState | ( | ) |
References App::GetApplication(), ParameterGrp::GetBool(), ParameterGrp::GetGroup(), and App::Application::GetUserParameter().
Referenced by Gui::PreferencePackManager::apply().
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:
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().
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().
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().
void DockWindowManager::retranslate | ( | ) |
Sets the window title for the dockable windows.
Referenced by Gui::Workbench::retranslate().
void DockWindowManager::saveState | ( | ) |
References App::GetApplication(), ParameterGrp::GetGroup(), App::Application::GetUserParameter(), and ParameterGrp::SetBool().
Referenced by Gui::MainWindow::saveWindowSettings(), and 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().
QWidget * DockWindowManager::unregisterDockWindow | ( | const char * | name | ) |