OpenWalnut
1.5.0dev
src
qtgui
abstractUI
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
36
WUIQtPropertyGroupWidget::WUIQtPropertyGroupWidget
(
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
49
WUIQtPropertyGroupWidget::~WUIQtPropertyGroupWidget
()
50
{
51
// cleanup
52
}
53
54
WPropGroup
WUIQtPropertyGroupWidget::getPropertyGroup
()
const
55
{
56
return
m_properties
;
57
}
58
59
QString
WUIQtPropertyGroupWidget::getTitleQString
()
const
60
{
61
return
QString::fromStdString(
getTitle
() );
62
}
63
64
void
WUIQtPropertyGroupWidget::show
()
65
{
66
WUIQtWidgetBase::show
();
67
}
68
69
void
WUIQtPropertyGroupWidget::setVisible
(
bool
visible )
70
{
71
WUIQtWidgetBase::setVisible
( visible );
72
}
73
74
bool
WUIQtPropertyGroupWidget::isVisible
()
const
75
{
76
return
WUIQtWidgetBase::isVisible
();
77
}
78
79
void
WUIQtPropertyGroupWidget::cleanUpGT
()
80
{
81
// nothing to do
82
}
83
84
void
WUIQtPropertyGroupWidget::close
()
85
{
86
// use WUIPropertyGroupWidget to handle this
87
WUIPropertyGroupWidget::close
();
88
}
89
90
void
WUIQtPropertyGroupWidget::closeImpl
()
91
{
92
// notify child widgets
93
WUIQtWidgetBase::closeImpl
();
94
}
95
96
void
WUIQtPropertyGroupWidget::realizeImpl
()
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:
101
m_propWidget
=
WQtPropertyGroupWidget::createPropertyGroupBox
(
m_properties
,
true
,
getTitleQString
(), 0,
getCompellingQParent
() );
102
103
// let WUIQtWidgetBase do the rest
104
embedContent
(
m_propWidget
);
105
}
106
WMainWindow
This class contains the main window and the layout of the widgets within the window.
Definition:
WMainWindow.h:66
WQtPropertyGroupWidget::createPropertyGroupBox
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.
Definition:
WQtPropertyGroupWidget.cpp:177
WUIPropertyGroupWidget
Widget which is a container for a WPropertyGroup.
Definition:
WUIPropertyGroupWidget.h:39
WUIQtPropertyGroupWidget::getPropertyGroup
virtual WPropGroup getPropertyGroup() const
The property group shown by this widget.
Definition:
WUIQtPropertyGroupWidget.cpp:54
WUIQtPropertyGroupWidget::setVisible
virtual void setVisible(bool visible=true)
Hide/show this widget.
Definition:
WUIQtPropertyGroupWidget.cpp:69
WUIQtPropertyGroupWidget::cleanUpGT
virtual void cleanUpGT()
Cleanup the GUI.
Definition:
WUIQtPropertyGroupWidget.cpp:79
WUIQtPropertyGroupWidget::getTitleQString
virtual QString getTitleQString() const
Title as QString.
Definition:
WUIQtPropertyGroupWidget.cpp:59
WUIQtPropertyGroupWidget::isVisible
virtual bool isVisible() const
Check if the widget is hidden or not.
Definition:
WUIQtPropertyGroupWidget.cpp:74
WUIQtPropertyGroupWidget::close
virtual void close()
Handle shutdown.
Definition:
WUIQtPropertyGroupWidget.cpp:84
WUIQtPropertyGroupWidget::m_properties
WPropGroup m_properties
The properties to show.
Definition:
WUIQtPropertyGroupWidget.h:170
WUIQtPropertyGroupWidget::closeImpl
virtual void closeImpl()
Close the widget.
Definition:
WUIQtPropertyGroupWidget.cpp:90
WUIQtPropertyGroupWidget::show
virtual void show()
Show this widget if not yet visible.
Definition:
WUIQtPropertyGroupWidget.cpp:64
WUIQtPropertyGroupWidget::m_propWidget
QWidget * m_propWidget
The prop widget.
Definition:
WUIQtPropertyGroupWidget.h:165
WUIQtPropertyGroupWidget::~WUIQtPropertyGroupWidget
virtual ~WUIQtPropertyGroupWidget()
Destructor.
Definition:
WUIQtPropertyGroupWidget.cpp:49
WUIQtPropertyGroupWidget::WUIQtPropertyGroupWidget
WUIQtPropertyGroupWidget(std::string title, WPropGroup properties, WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent=WUIQtWidgetBase::SPtr())
Default constructor.
Definition:
WUIQtPropertyGroupWidget.cpp:36
WUIQtPropertyGroupWidget::realizeImpl
virtual void realizeImpl()
Realize the widget.
Definition:
WUIQtPropertyGroupWidget.cpp:96
WUIQtWidgetBase
Implementation of WUIWidgetBase.
Definition:
WUIQtWidgetBase.h:40
WUIQtWidgetBase::getCompellingQParent
QWidget * getCompellingQParent() const
Returns the parent to use for your implementation in realizeImpl.
Definition:
WUIQtWidgetBase.cpp:229
WUIQtWidgetBase::show
virtual void show()
Show this widget if not yet visible.
Definition:
WUIQtWidgetBase.cpp:88
WUIQtWidgetBase::SPtr
std::shared_ptr< WUIQtWidgetBase > SPtr
Convenience typedef for a std::shared_ptr< WUIQtWidgetBase >.
Definition:
WUIQtWidgetBase.h:45
WUIQtWidgetBase::setVisible
virtual void setVisible(bool visible=true)
Hide/show this widget.
Definition:
WUIQtWidgetBase.cpp:96
WUIQtWidgetBase::isVisible
virtual bool isVisible() const
Check if the widget is hidden or not.
Definition:
WUIQtWidgetBase.cpp:104
WUIQtWidgetBase::closeImpl
virtual void closeImpl()
Close the widget.
Definition:
WUIQtWidgetBase.cpp:113
WUIQtWidgetBase::embedContent
QWidget * embedContent(QWidget *content)
This method can be used if you just create some QWidget and do not want to take care about embedding ...
Definition:
WUIQtWidgetBase.cpp:177
WUIWidgetBase::close
void close()
Close the widget.
Definition:
WUIWidgetBase.cpp:50
WUIWidgetBase::getTitle
virtual std::string getTitle() const
Get the title of the widget.
Definition:
WUIWidgetBase.cpp:45
Generated by
1.9.1