VPTissue Reference Manual
PTreeQtState.h
Go to the documentation of this file.
1 #ifndef SIMSHELL_PTREEQTSTATE_H_INCLUDED
2 #define SIMSHELL_PTREEQTSTATE_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include <map>
23 #include <boost/property_tree/ptree.hpp>
24 #include <QMainWindow>
25 
26 class QDockWidget;
27 class QTreeView;
28 class QWidget;
29 
30 namespace SimShell {
31 
41 {
42 public:
46  static boost::property_tree::ptree GetTreeViewState(const QTreeView*);
47 
51  static void SetTreeViewState(QTreeView*, const boost::property_tree::ptree&);
52 
56  static boost::property_tree::ptree GetWidgetState(const QWidget*);
57 
61  static void SetWidgetState(QWidget*, const boost::property_tree::ptree&);
62 
66  static boost::property_tree::ptree GetDockWidgetState(const QDockWidget*);
67 
71  static void SetDockWidgetState(QDockWidget*, const boost::property_tree::ptree&);
72 
76  static boost::property_tree::ptree GetDockWidgetArea(const QMainWindow*, QDockWidget*);
77 
78  /*
79  * Set DockWidgetArea as a ptree of dock widget in main window.
80  */
81  static void SetDockWidgetArea(QMainWindow*, QDockWidget*, const boost::property_tree::ptree&);
82 
83 private:
84  static const std::map<Qt::DockWidgetArea, std::string> g_dock_widget_area_to_string;
85  static const std::map<std::string, Qt::DockWidgetArea> g_string_to_dock_widget_area;
86 };
87 
88 } // namespace
89 
90 #endif // end-of-include-guard
static boost::property_tree::ptree GetWidgetState(const QWidget *)
Get ptree representation of typical widget properties (hidden/shown, size, position, ...)
Utility for representing state of various Qt widgets as a ptree.
Definition: PTreeQtState.h:40
static void SetDockWidgetState(QDockWidget *, const boost::property_tree::ptree &)
Set state of given dock widget as represented by given ptree.
static void SetWidgetState(QWidget *, const boost::property_tree::ptree &)
Set state of given widget as represented by given ptree.
static boost::property_tree::ptree GetTreeViewState(const QTreeView *)
Get ptree representation of expand/collapsed state of items in given QTreeView.
see the online Qt documentation
static boost::property_tree::ptree GetDockWidgetState(const QDockWidget *)
Get ptree representatoin of dock widget-specific properties.
see the online Qt documentation
static boost::property_tree::ptree GetDockWidgetArea(const QMainWindow *, QDockWidget *)
Get DockWidgetArea of dock widget in main window as a ptree.
see the online Qt documentation
see the online Qt documentation
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
static void SetTreeViewState(QTreeView *, const boost::property_tree::ptree &)
Set expand/collapsed state of items in given QTreeView as represented by given ptree.