Tulip  4.7.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
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 <QPushButton>
26 
27 
28 #include <tulip/tulipconf.h>
29 
30 class QSlider;
31 
32 class TLP_QT_SCOPE ScrollPopupButton : public QPushButton {
33  Q_OBJECT
34  Q_PROPERTY(int value READ value WRITE setValue)
35  Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
36  Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
37 
38  QSlider* _slider;
39 
40 public:
41  explicit ScrollPopupButton(QWidget *parent = 0);
42  int value() const;
43  int maximum() const;
44  int minimum() const;
45 
46 public slots:
47  virtual void showPopup();
48  virtual void hidePopup();
49  void setPopupVisible(bool);
50  void setValue(int);
51  void setMinimum(int);
52  void setMaximum(int);
53 
54 signals:
55  void valueChanged(int);
56 
57 protected:
58  bool eventFilter(QObject *, QEvent *);
59 };
60 
61 #endif // SCROLLPOPUPBUTTON_H
62 ///@endcond