OpenWalnut
1.5.0dev
src
qtgui
controlPanel
WPropertyStringWidget.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 WPROPERTYSTRINGWIDGET_H
26
#define WPROPERTYSTRINGWIDGET_H
27
28
#include <string>
29
30
#include <QLineEdit>
31
#include <QSlider>
32
#include <QHBoxLayout>
33
34
#include "../guiElements/WScaleLabel.h"
35
#include "WPropertyWidget.h"
36
37
/**
38
* Implements a property widget for WPropString.
39
*/
40
class
WPropertyStringWidget
:
public
WPropertyWidget
41
{
42
Q_OBJECT
43
public
:
44
/**
45
* Constructor. Creates a new widget appropriate for the specified property.
46
*
47
* \param property the property to handle
48
* \param parent the parent widget.
49
* \param propertyGrid the grid used to layout the labels and property widgets
50
*/
51
WPropertyStringWidget
( WPropString property, QGridLayout* propertyGrid, QWidget* parent = 0 );
52
53
/**
54
* Destructor.
55
*/
56
virtual
~WPropertyStringWidget
();
57
58
/**
59
* Disable the ability to select text. This is only applicable if in information mode.
60
*
61
* \param disable true to disable.
62
*/
63
void
disableTextInteraction
(
bool
disable =
true
);
64
65
protected
:
66
/**
67
* Called whenever the widget should update.
68
*/
69
virtual
void
update
();
70
71
/**
72
* The integer property represented by this widget.
73
*/
74
WPropString
m_stringProperty
;
75
76
/**
77
* The edit field showing the value
78
*/
79
QLineEdit
m_edit
;
80
81
/**
82
* Layout used to position the label and the checkbox
83
*/
84
QHBoxLayout
m_layout
;
85
86
/**
87
* Used to show the property as text.
88
*/
89
WScaleLabel
m_asText
;
90
91
/**
92
* The layout used for the pure output (information properties)
93
*/
94
QHBoxLayout
m_infoLayout
;
95
96
private
:
97
public
slots:
98
99
/**
100
* Called whenever the edit field changes
101
*/
102
void
editChanged
();
103
104
/**
105
* Called when the text in m_edit changes.
106
*
107
* \param text
108
*/
109
void
textEdited
(
const
QString& text );
110
};
111
112
#endif
// WPROPERTYSTRINGWIDGET_H
113
WPropertyStringWidget
Implements a property widget for WPropString.
Definition:
WPropertyStringWidget.h:41
WPropertyStringWidget::disableTextInteraction
void disableTextInteraction(bool disable=true)
Disable the ability to select text.
Definition:
WPropertyStringWidget.cpp:74
WPropertyStringWidget::m_infoLayout
QHBoxLayout m_infoLayout
The layout used for the pure output (information properties)
Definition:
WPropertyStringWidget.h:94
WPropertyStringWidget::editChanged
void editChanged()
Called whenever the edit field changes.
Definition:
WPropertyStringWidget.cpp:87
WPropertyStringWidget::m_stringProperty
WPropString m_stringProperty
The integer property represented by this widget.
Definition:
WPropertyStringWidget.h:74
WPropertyStringWidget::textEdited
void textEdited(const QString &text)
Called when the text in m_edit changes.
Definition:
WPropertyStringWidget.cpp:94
WPropertyStringWidget::m_edit
QLineEdit m_edit
The edit field showing the value.
Definition:
WPropertyStringWidget.h:79
WPropertyStringWidget::~WPropertyStringWidget
virtual ~WPropertyStringWidget()
Destructor.
Definition:
WPropertyStringWidget.cpp:69
WPropertyStringWidget::m_asText
WScaleLabel m_asText
Used to show the property as text.
Definition:
WPropertyStringWidget.h:89
WPropertyStringWidget::m_layout
QHBoxLayout m_layout
Layout used to position the label and the checkbox.
Definition:
WPropertyStringWidget.h:84
WPropertyStringWidget::WPropertyStringWidget
WPropertyStringWidget(WPropString property, QGridLayout *propertyGrid, QWidget *parent=0)
Constructor.
Definition:
WPropertyStringWidget.cpp:34
WPropertyStringWidget::update
virtual void update()
Called whenever the widget should update.
Definition:
WPropertyStringWidget.cpp:80
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