OpenWalnut  1.5.0dev
WPropertyIntervalWidget.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 WPROPERTYINTERVALWIDGET_H
26 #define WPROPERTYINTERVALWIDGET_H
27 
28 #include <string>
29 
30 #include <QLineEdit>
31 #include <QSlider>
32 #include <QHBoxLayout>
33 #include <QToolButton>
34 
35 #include "../guiElements/WQtIntervalEdit.h"
36 #include "../guiElements/WScaleLabel.h"
37 
38 #include "WPropertyWidget.h"
39 
40 /**
41  * Implements a property widget for WPropInterval.
42  */
44 {
45  Q_OBJECT
46 public:
47  /**
48  * Constructor. Creates a new widget appropriate for the specified property.
49  *
50  * \param property the property to handle
51  * \param parent the parent widget.
52  * \param propertyGrid the grid used to layout the labels and property widgets
53  */
54  WPropertyIntervalWidget( WPropInterval property, QGridLayout* propertyGrid, QWidget* parent = 0 );
55 
56  /**
57  * Destructor.
58  */
59  virtual ~WPropertyIntervalWidget();
60 
61 protected:
62  /**
63  * Called whenever the widget should update.
64  */
65  virtual void update();
66 
67  /**
68  * The property represented by this widget.
69  */
70  WPropInterval m_intervalProperty;
71 
72  /**
73  * Layout used to position the label and the checkbox
74  */
75  QHBoxLayout m_layout;
76 
77  /**
78  * Layout used to combine the property widgets with the WQtIntervalEdit.
79  */
80  QVBoxLayout m_vLayout;
81 
82  /**
83  * Used to show the property as text.
84  */
86 
87  /**
88  * The layout used for the pure output (information properties)
89  */
90  QHBoxLayout m_infoLayout;
91 
92  /**
93  * Minimum Value.
94  */
95  QLineEdit m_minEdit;
96 
97  /**
98  * Maximum Value.
99  */
100  QLineEdit m_maxEdit;
101 
102  /**
103  * Reset button
104  */
105  QToolButton m_resetBtn;
106 private:
107 public slots:
108 
109  /**
110  * Called whenever the interval edit changes.
111  */
112  void minMaxUpdated();
113 
114  /**
115  * Reset to default
116  */
117  void reset();
118 };
119 
120 #endif // WPROPERTYINTERVALWIDGET_H
121 
Implements a property widget for WPropInterval.
WPropInterval m_intervalProperty
The property represented by this widget.
QLineEdit m_minEdit
Minimum Value.
WScaleLabel m_asText
Used to show the property as text.
virtual void update()
Called whenever the widget should update.
QToolButton m_resetBtn
Reset button.
QHBoxLayout m_infoLayout
The layout used for the pure output (information properties)
WPropertyIntervalWidget(WPropInterval property, QGridLayout *propertyGrid, QWidget *parent=0)
Constructor.
QLineEdit m_maxEdit
Maximum Value.
QHBoxLayout m_layout
Layout used to position the label and the checkbox.
void reset()
Reset to default.
virtual ~WPropertyIntervalWidget()
Destructor.
void minMaxUpdated()
Called whenever the interval edit changes.
QVBoxLayout m_vLayout
Layout used to combine the property widgets with the WQtIntervalEdit.
Class building the base for all widgets representing properties.
Special Label that can shrink and expand in a layout.
Definition: WScaleLabel.h:37