OpenWalnut
1.5.0dev
src
qtgui
controlPanel
WPropertyMatrix4X4Widget.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 WPROPERTYMATRIX4X4WIDGET_H
26
#define WPROPERTYMATRIX4X4WIDGET_H
27
28
#include <string>
29
30
#include <QLineEdit>
31
#include <QSlider>
32
#include <QHBoxLayout>
33
34
#include "../guiElements/WScaleLabel.h"
35
36
#include "WPropertyWidget.h"
37
38
class
WScaleLabel
;
39
40
/**
41
* Implements a property widget for MATRIX4X4.
42
*/
43
class
WPropertyMatrix4X4Widget
:
public
WPropertyWidget
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
WPropertyMatrix4X4Widget
( WPropMatrix4X4 property, QGridLayout* propertyGrid, QWidget* parent = 0 );
55
56
/**
57
* Destructor.
58
*/
59
virtual
~WPropertyMatrix4X4Widget
();
60
61
protected
:
62
/**
63
* Called whenever the widget should update.
64
*/
65
virtual
void
update
();
66
67
/**
68
* The integer property represented by this widget.
69
*/
70
WPropMatrix4X4
m_matrixProperty
;
71
72
/**
73
* The edit field showing the value of the slider
74
*/
75
QLineEdit
m_edits
[16];
76
77
/**
78
* Layout used to position the label and the widgets
79
*/
80
QVBoxLayout
m_layout
;
81
82
/**
83
* Used to show the property as text.
84
*/
85
WScaleLabel
m_asText
;
86
87
/**
88
* The layout used for the pure output (information properties)
89
*/
90
QHBoxLayout
m_infoLayout
;
91
92
/**
93
* Updates the property using the edit X Y and Z widgets.
94
*
95
* \param validateOnly true if the prop should not really be set. Just validated.
96
*/
97
void
setPropertyFromWidgets
(
bool
validateOnly =
false
);
98
99
private
:
100
public
slots:
101
102
/**
103
* Called whenever the edit field changes
104
*/
105
void
editChanged
();
106
107
/**
108
* Called when the text in m_edit changes.
109
*
110
* \param text
111
*/
112
void
textEdited
(
const
QString& text );
113
};
114
115
#endif
// WPROPERTYMATRIX4X4WIDGET_H
116
WPropertyMatrix4X4Widget
Implements a property widget for MATRIX4X4.
Definition:
WPropertyMatrix4X4Widget.h:44
WPropertyMatrix4X4Widget::m_matrixProperty
WPropMatrix4X4 m_matrixProperty
The integer property represented by this widget.
Definition:
WPropertyMatrix4X4Widget.h:70
WPropertyMatrix4X4Widget::m_layout
QVBoxLayout m_layout
Layout used to position the label and the widgets.
Definition:
WPropertyMatrix4X4Widget.h:80
WPropertyMatrix4X4Widget::editChanged
void editChanged()
Called whenever the edit field changes.
Definition:
WPropertyMatrix4X4Widget.cpp:102
WPropertyMatrix4X4Widget::m_infoLayout
QHBoxLayout m_infoLayout
The layout used for the pure output (information properties)
Definition:
WPropertyMatrix4X4Widget.h:90
WPropertyMatrix4X4Widget::setPropertyFromWidgets
void setPropertyFromWidgets(bool validateOnly=false)
Updates the property using the edit X Y and Z widgets.
Definition:
WPropertyMatrix4X4Widget.cpp:112
WPropertyMatrix4X4Widget::m_asText
WScaleLabel m_asText
Used to show the property as text.
Definition:
WPropertyMatrix4X4Widget.h:85
WPropertyMatrix4X4Widget::textEdited
void textEdited(const QString &text)
Called when the text in m_edit changes.
Definition:
WPropertyMatrix4X4Widget.cpp:107
WPropertyMatrix4X4Widget::update
virtual void update()
Called whenever the widget should update.
Definition:
WPropertyMatrix4X4Widget.cpp:84
WPropertyMatrix4X4Widget::WPropertyMatrix4X4Widget
WPropertyMatrix4X4Widget(WPropMatrix4X4 property, QGridLayout *propertyGrid, QWidget *parent=0)
Constructor.
Definition:
WPropertyMatrix4X4Widget.cpp:38
WPropertyMatrix4X4Widget::~WPropertyMatrix4X4Widget
virtual ~WPropertyMatrix4X4Widget()
Destructor.
Definition:
WPropertyMatrix4X4Widget.cpp:79
WPropertyMatrix4X4Widget::m_edits
QLineEdit m_edits[16]
The edit field showing the value of the slider.
Definition:
WPropertyMatrix4X4Widget.h:75
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