OpenWalnut
1.5.0dev
src
qtgui
controlPanel
WPropertySelectionWidget.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 WPROPERTYSELECTIONWIDGET_H
26
#define WPROPERTYSELECTIONWIDGET_H
27
28
#include <string>
29
30
#include <QComboBox>
31
#include <QListWidget>
32
#include <QHBoxLayout>
33
34
#include "WPropertyWidget.h"
35
36
/**
37
* Implements a property widget for WPropSelection.
38
*/
39
class
WPropertySelectionWidget
:
public
WPropertyWidget
40
{
41
Q_OBJECT
42
public
:
43
/**
44
* Constructor. Creates a new widget appropriate for the specified property.
45
*
46
* \param property the property to handle
47
* \param parent the parent widget.
48
* \param propertyGrid the grid used to layout the labels and property widgets
49
*/
50
WPropertySelectionWidget
( WPropSelection property, QGridLayout* propertyGrid, QWidget* parent = 0 );
51
52
/**
53
* Destructor.
54
*/
55
virtual
~WPropertySelectionWidget
();
56
57
protected
:
58
/**
59
* Called whenever the widget should update.
60
*/
61
virtual
void
update
();
62
63
/**
64
* The integer property represented by this widget.
65
*/
66
WPropSelection
m_selectionProperty
;
67
68
/**
69
* The list holding all items
70
*/
71
QListWidget*
m_list
;
72
73
/**
74
* The combobox holding all items.
75
*/
76
QComboBox*
m_combo
;
77
78
/**
79
* Layout used to position the label and the checkbox
80
*/
81
QGridLayout
m_layout
;
82
83
/**
84
* True if a selection update is currently in progress. This is needed as QT does not provide a signal for selection changes which is NOT
85
* called when changed programmatically.
86
*/
87
bool
m_update
;
88
89
private
:
90
public
slots:
91
92
/**
93
* Called whenever the selection in m_list has changed.
94
*/
95
void
listSelectionChanged
();
96
97
/**
98
* Selection of the combobox has changed.
99
*
100
* \param index the new index
101
*/
102
void
comboSelectionChanged
(
int
index );
103
};
104
105
#endif
// WPROPERTYSELECTIONWIDGET_H
106
WPropertySelectionWidget
Implements a property widget for WPropSelection.
Definition:
WPropertySelectionWidget.h:40
WPropertySelectionWidget::m_selectionProperty
WPropSelection m_selectionProperty
The integer property represented by this widget.
Definition:
WPropertySelectionWidget.h:66
WPropertySelectionWidget::m_list
QListWidget * m_list
The list holding all items.
Definition:
WPropertySelectionWidget.h:71
WPropertySelectionWidget::WPropertySelectionWidget
WPropertySelectionWidget(WPropSelection property, QGridLayout *propertyGrid, QWidget *parent=0)
Constructor.
Definition:
WPropertySelectionWidget.cpp:67
WPropertySelectionWidget::~WPropertySelectionWidget
virtual ~WPropertySelectionWidget()
Destructor.
Definition:
WPropertySelectionWidget.cpp:139
WPropertySelectionWidget::m_layout
QGridLayout m_layout
Layout used to position the label and the checkbox.
Definition:
WPropertySelectionWidget.h:81
WPropertySelectionWidget::m_combo
QComboBox * m_combo
The combobox holding all items.
Definition:
WPropertySelectionWidget.h:76
WPropertySelectionWidget::listSelectionChanged
void listSelectionChanged()
Called whenever the selection in m_list has changed.
Definition:
WPropertySelectionWidget.cpp:277
WPropertySelectionWidget::m_update
bool m_update
True if a selection update is currently in progress.
Definition:
WPropertySelectionWidget.h:87
WPropertySelectionWidget::update
virtual void update()
Called whenever the widget should update.
Definition:
WPropertySelectionWidget.cpp:144
WPropertySelectionWidget::comboSelectionChanged
void comboSelectionChanged(int index)
Selection of the combobox has changed.
Definition:
WPropertySelectionWidget.cpp:263
WPropertyWidget
Class building the base for all widgets representing properties.
Definition:
WPropertyWidget.h:45
Generated by
1.9.1