OpenWalnut  1.5.0dev
WUIQtPropertyGroupWidget.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #include <string>
26 
27 #include <QGridLayout>
28 
29 #include "core/common/WConditionOneShot.h"
30 #include "core/common/WFlag.h"
31 
32 #include "../guiElements/WQtDockWidget.h"
33 
34 #include "WUIQtPropertyGroupWidget.h"
35 
37  std::string title,
38  WPropGroup properties,
39  WMainWindow* mainWindow,
40  WUIQtWidgetBase::SPtr parent ):
41  WUIPropertyGroupWidget( title ),
42  WUIQtWidgetBase( mainWindow, parent ),
43  m_propWidget( NULL ),
44  m_properties( properties )
45 {
46  // initialize members
47 }
48 
50 {
51  // cleanup
52 }
53 
55 {
56  return m_properties;
57 }
58 
60 {
61  return QString::fromStdString( getTitle() );
62 }
63 
65 {
67 }
68 
70 {
71  WUIQtWidgetBase::setVisible( visible );
72 }
73 
75 {
77 }
78 
80 {
81  // nothing to do
82 }
83 
85 {
86  // use WUIPropertyGroupWidget to handle this
88 }
89 
91 {
92  // notify child widgets
94 }
95 
97 {
98  // this is called from withing the GUI thread -> we can safely create QT widgets here
99 
100  // this widget does what we want:
102 
103  // let WUIQtWidgetBase do the rest
105 }
106 
This class contains the main window and the layout of the widgets within the window.
Definition: WMainWindow.h:66
static QWidget * createPropertyGroupBox(QWidget *widget, bool asScrollArea=false, QWidget *parent=NULL, const QString &title="", int nestingLevel=0)
This function creates the fancy box around your specified group widget.
Widget which is a container for a WPropertyGroup.
virtual WPropGroup getPropertyGroup() const
The property group shown by this widget.
virtual void setVisible(bool visible=true)
Hide/show this widget.
virtual void cleanUpGT()
Cleanup the GUI.
virtual QString getTitleQString() const
Title as QString.
virtual bool isVisible() const
Check if the widget is hidden or not.
virtual void close()
Handle shutdown.
WPropGroup m_properties
The properties to show.
virtual void closeImpl()
Close the widget.
virtual void show()
Show this widget if not yet visible.
QWidget * m_propWidget
The prop widget.
virtual ~WUIQtPropertyGroupWidget()
Destructor.
WUIQtPropertyGroupWidget(std::string title, WPropGroup properties, WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent=WUIQtWidgetBase::SPtr())
Default constructor.
virtual void realizeImpl()
Realize the widget.
Implementation of WUIWidgetBase.
QWidget * getCompellingQParent() const
Returns the parent to use for your implementation in realizeImpl.
virtual void show()
Show this widget if not yet visible.
std::shared_ptr< WUIQtWidgetBase > SPtr
Convenience typedef for a std::shared_ptr< WUIQtWidgetBase >.
virtual void setVisible(bool visible=true)
Hide/show this widget.
virtual bool isVisible() const
Check if the widget is hidden or not.
virtual void closeImpl()
Close the widget.
QWidget * embedContent(QWidget *content)
This method can be used if you just create some QWidget and do not want to take care about embedding ...
void close()
Close the widget.
virtual std::string getTitle() const
Get the title of the widget.