OpenWalnut  1.5.0dev
WPropertyFilenameWidget.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 WPROPERTYFILENAMEWIDGET_H
26 #define WPROPERTYFILENAMEWIDGET_H
27 
28 #include <string>
29 
30 #include <QPushButton>
31 #include <QHBoxLayout>
32 #include <QtCore/QMimeData>
33 #include <QtCore/QUrl>
34 #include <QDragEnterEvent>
35 #include <QDropEvent>
36 
37 #include "../guiElements/WScaleLabel.h"
38 
39 #include "WPropertyWidget.h"
40 
41 /**
42  * Implements a property widget for WPropColor.
43  */
45 {
46  Q_OBJECT
47 public:
48  /**
49  * Constructor. Creates a new widget appropriate for the specified property.
50  *
51  * \param property the property to handle
52  * \param parent the parent widget.
53  * \param propertyGrid the grid used to layout the labels and property widgets
54  */
55  WPropertyFilenameWidget( WPropFilename property, QGridLayout* propertyGrid, QWidget* parent = 0 );
56 
57  /**
58  * Destructor.
59  */
60  virtual ~WPropertyFilenameWidget();
61 
62 protected:
63  /**
64  * Called whenever the widget should update.
65  */
66  virtual void update();
67 
68  /**
69  * The filename property represented by this widget.
70  */
71  WPropFilename m_fnProperty;
72 
73  /**
74  * The button field showing the value
75  */
76  QPushButton m_button;
77 
78  /**
79  * Layout used to position the label and the checkbox
80  */
81  QHBoxLayout m_layout;
82 
83  /**
84  * Used to show the property as text.
85  */
87 
88  /**
89  * The layout used for the pure output (information properties)
90  */
91  QHBoxLayout m_infoLayout;
92 
93  /**
94  * Reimplemented to accept color drops
95  * \param event the handled event
96  */
97  virtual void dragEnterEvent( QDragEnterEvent* event );
98 
99  /**
100  * Reimplemented to accept color drops
101  * \param event the handled event
102  */
103  virtual void dropEvent( QDropEvent* event );
104 
105 private:
106 public slots:
107 
108  /**
109  * Called when the m_button was pressed.
110  */
111  void buttonReleased();
112 };
113 
114 #endif // WPROPERTYFILENAMEWIDGET_H
115 
Implements a property widget for WPropColor.
QHBoxLayout m_layout
Layout used to position the label and the checkbox.
WPropFilename m_fnProperty
The filename property represented by this widget.
void buttonReleased()
Called when the m_button was pressed.
QPushButton m_button
The button field showing the value.
virtual void update()
Called whenever the widget should update.
WPropertyFilenameWidget(WPropFilename property, QGridLayout *propertyGrid, QWidget *parent=0)
Constructor.
virtual ~WPropertyFilenameWidget()
Destructor.
WScaleLabel m_asText
Used to show the property as text.
virtual void dropEvent(QDropEvent *event)
Reimplemented to accept color drops.
QHBoxLayout m_infoLayout
The layout used for the pure output (information properties)
virtual void dragEnterEvent(QDragEnterEvent *event)
Reimplemented to accept color drops.
Class building the base for all widgets representing properties.
virtual bool event(QEvent *event)
Custom event dispatcher.
Special Label that can shrink and expand in a layout.
Definition: WScaleLabel.h:37