VPTissue Reference Manual
MyDockWidget.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "MyDockWidget.h"
21 
22 #include "common/PTreeQtState.h"
23 
24 
25 using namespace std;
26 using namespace boost::property_tree;
27 
28 namespace SimShell {
29 namespace Gui {
30 
31 MyDockWidget::MyDockWidget(QWidget* parent)
32  : QDockWidget(parent)
33 {
34 }
35 
36 ptree MyDockWidget::GetPTreeState() const
37 {
38  ptree result;
39  result.put_child("widget", PTreeQtState::GetWidgetState(this));
40  result.put_child("dock", PTreeQtState::GetDockWidgetState(this));
41  return result;
42 }
43 
44 void MyDockWidget::SetPTreeState(const ptree& state)
45 {
46  auto widget_state = state.get_child_optional("widget");
47  if (widget_state)
48  PTreeQtState::SetWidgetState(this, widget_state.get());
49 
50  auto dock_state = state.get_child_optional("dock");
51  if (dock_state) {
52  PTreeQtState::SetDockWidgetState(this, dock_state.get());
53  }
54 }
55 
56 } // namespace Gui
57 } // namespace SimShell
STL namespace.
Interface for PTreeQtState.
see the online Qt documentation
see the online Qt documentation
Header for MyDockWidget.
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32