Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
ScrollPopupButton.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 
22 #ifndef SCROLLPOPUPBUTTON_H
23 #define SCROLLPOPUPBUTTON_H
24 
25 #include <QtGui/QPushButton>
26 #include <tulip/tulipconf.h>
27 class QSlider;
28 
29 class TLP_QT_SCOPE ScrollPopupButton : public QPushButton {
30  Q_OBJECT
31  Q_PROPERTY(int value READ value WRITE setValue)
32  Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
33  Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
34 
35  QSlider* _slider;
36 
37 public:
38  explicit ScrollPopupButton(QWidget *parent = 0);
39  int value() const;
40  int maximum() const;
41  int minimum() const;
42 
43 public slots:
44  virtual void showPopup();
45  virtual void hidePopup();
46  void setPopupVisible(bool);
47  void setValue(int);
48  void setMinimum(int);
49  void setMaximum(int);
50 
51 signals:
52  void valueChanged(int);
53 
54 protected:
55  bool eventFilter(QObject *, QEvent *);
56 };
57 
58 #endif // SCROLLPOPUPBUTTON_H
59 ///@endcond