OpenWalnut
1.5.0dev
src
qtgui
controlPanel
WPropertyBoolWidget.h
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
#ifndef WPROPERTYBOOLWIDGET_H
26
#define WPROPERTYBOOLWIDGET_H
27
28
#include <string>
29
30
#include <QCheckBox>
31
#include <QAction>
32
#include <QHBoxLayout>
33
34
#include "../guiElements/WScaleLabel.h"
35
36
#include "WPropertyWidget.h"
37
38
/**
39
* Implements a property widget for WPropBool.
40
*/
41
class
WPropertyBoolWidget
:
public
WPropertyWidget
42
{
43
Q_OBJECT
44
public
:
45
/**
46
* Constructor. Creates a new widget appropriate for the specified property.
47
*
48
* \param property the property to handle
49
* \param parent the parent widget.
50
* \param propertyGrid the grid used to layout the labels and property widgets
51
*/
52
WPropertyBoolWidget
( WPropBool property, QGridLayout* propertyGrid, QWidget* parent = 0 );
53
54
/**
55
* Destructor.
56
*/
57
virtual
~WPropertyBoolWidget
();
58
59
protected
:
60
/**
61
* Called whenever the widget should update.
62
*/
63
virtual
void
update
();
64
65
/**
66
* The boolean property represented by this widget.
67
*/
68
WPropBool
m_boolProperty
;
69
70
/**
71
* The checkbox - represents the boolean value.
72
*/
73
QCheckBox
m_checkbox
;
74
75
/**
76
* Layout used to position the label and the checkbox
77
*/
78
QHBoxLayout
m_layout
;
79
80
/**
81
* Used to show the property as text.
82
*/
83
WScaleLabel
m_asText
;
84
85
/**
86
* The layout used for the pure output (information properties)
87
*/
88
QHBoxLayout
m_infoLayout
;
89
90
private
:
91
public
slots:
92
93
/**
94
* called whenever the user modifies the checkbox
95
*/
96
void
checkboxChanged
();
97
};
98
99
#endif
// WPROPERTYBOOLWIDGET_H
100
WPropertyBoolWidget
Implements a property widget for WPropBool.
Definition:
WPropertyBoolWidget.h:42
WPropertyBoolWidget::m_asText
WScaleLabel m_asText
Used to show the property as text.
Definition:
WPropertyBoolWidget.h:83
WPropertyBoolWidget::~WPropertyBoolWidget
virtual ~WPropertyBoolWidget()
Destructor.
Definition:
WPropertyBoolWidget.cpp:59
WPropertyBoolWidget::checkboxChanged
void checkboxChanged()
called whenever the user modifies the checkbox
Definition:
WPropertyBoolWidget.cpp:71
WPropertyBoolWidget::WPropertyBoolWidget
WPropertyBoolWidget(WPropBool property, QGridLayout *propertyGrid, QWidget *parent=0)
Constructor.
Definition:
WPropertyBoolWidget.cpp:30
WPropertyBoolWidget::m_infoLayout
QHBoxLayout m_infoLayout
The layout used for the pure output (information properties)
Definition:
WPropertyBoolWidget.h:88
WPropertyBoolWidget::m_checkbox
QCheckBox m_checkbox
The checkbox - represents the boolean value.
Definition:
WPropertyBoolWidget.h:73
WPropertyBoolWidget::m_boolProperty
WPropBool m_boolProperty
The boolean property represented by this widget.
Definition:
WPropertyBoolWidget.h:68
WPropertyBoolWidget::update
virtual void update()
Called whenever the widget should update.
Definition:
WPropertyBoolWidget.cpp:64
WPropertyBoolWidget::m_layout
QHBoxLayout m_layout
Layout used to position the label and the checkbox.
Definition:
WPropertyBoolWidget.h:78
WPropertyWidget
Class building the base for all widgets representing properties.
Definition:
WPropertyWidget.h:45
WScaleLabel
Special Label that can shrink and expand in a layout.
Definition:
WScaleLabel.h:37
Generated by
1.9.1