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