tuchulcha  0.10.1
Graphical Workflow Configuration Editor
QFilterWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2013 Jens-Malte Gottfried
2 
3  This file is part of Tuchulcha.
4 
5  Tuchulcha is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Tuchulcha is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Tuchulcha. If not, see <http://www.gnu.org/licenses/>.
17 */
28 #ifndef QFILTERWIDGET_H
29 #define QFILTERWIDGET_H
30 
31 #include <QLineEdit>
32 #include <QToolButton>
33 
34 QT_BEGIN_NAMESPACE
35 
36 class QToolButton;
37 
39 #define ICONBUTTON_SIZE 16
40 
42 class QIconButton: public QToolButton
43 {
44  Q_OBJECT
46  Q_PROPERTY(float fader READ fader WRITE setFader)
47 public:
49  QIconButton(QWidget* parent );
51  void paintEvent(QPaintEvent* event );
53  float fader() { return m_fader; }
55  void setFader(float value ) { m_fader = value; update(); }
57  void animateShow(bool visible );
58 
59 private:
61  float m_fader;
62 };
63 
65 class QFilterWidget : public QLineEdit
66 {
67  Q_OBJECT
68 public:
70  explicit QFilterWidget(QWidget* parent = 0 );
72 
73  void resizeEvent(QResizeEvent* event );
74 
75 private slots:
77  void checkButton(const QString& text);
78 
79 private:
81  QString _oldText;
82 };
83 
84 QT_END_NAMESPACE
85 
86 #endif
QIconButton(QWidget *parent)
default constructor
FilterWidget: For filtering item views, with reset button.
Definition: QFilterWidget.h:65
void animateShow(bool visible)
fade in or out
void resizeEvent(QResizeEvent *event)
handle resize
QString _oldText
text cache (for checkButton(QString))
Definition: QFilterWidget.h:81
void paintEvent(QPaintEvent *event)
handle fade parameter
This is a simple helper class that represents clickable icons.
Definition: QFilterWidget.h:42
QIconButton * _resetButton
reset button
Definition: QFilterWidget.h:80
void checkButton(const QString &text)
check for fade in/out of the icon button
float fader()
get fade value
Definition: QFilterWidget.h:53
QFilterWidget(QWidget *parent=0)
default constructor
float m_fader
fading state
Definition: QFilterWidget.h:61
void setFader(float value)
set fade value
Definition: QFilterWidget.h:55