Tulip  5.7.4
Large graphs analysis and drawing
ScrollPopupButton.h
1 /*
2  *
3  * This file is part of Tulip (https://tulip.labri.fr)
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 #ifndef SCROLLPOPUPBUTTON_H
22 #define SCROLLPOPUPBUTTON_H
23 
24 #include <QPushButton>
25 
26 #include <tulip/tulipconf.h>
27 
28 class QSlider;
29 
30 class TLP_QT_SCOPE ScrollPopupButton : public QPushButton {
31  Q_OBJECT
32  Q_PROPERTY(int value READ value WRITE setValue)
33  Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
34  Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
35 
36  QSlider *_slider;
37 
38 public:
39  explicit ScrollPopupButton(QWidget *parent = nullptr);
40  int value() const;
41  int maximum() const;
42  int minimum() const;
43 
44 public slots:
45  virtual void showPopup();
46  virtual void hidePopup();
47  void setPopupVisible(bool);
48  void setValue(int);
49  void setMinimum(int);
50  void setMaximum(int);
51 
52 signals:
53  void valueChanged(int);
54 
55 protected:
56  bool eventFilter(QObject *, QEvent *) override;
57 };
58 
59 #endif // SCROLLPOPUPBUTTON_H
60 ///@endcond