itom  4.1.0
popupWidget.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 
27  This file is a port and modified version of the
28  CTK Common Toolkit (http://www.commontk.org)
29 *********************************************************************** */
30 
31 #ifndef POPUPWIDGET_H
32 #define POPUPWIDGET_H
33 
34 // CTK includes
35 #include "basePopupWidget.h"
36 
37 class PopupWidgetPrivate;
38 
41 class ITOMWIDGETS_EXPORT PopupWidget : public BasePopupWidget
42 {
43  Q_OBJECT
44 
52  Q_PROPERTY( bool active READ isActive WRITE setActive)
53 
54 
55  Q_PROPERTY( bool autoShow READ autoShow WRITE setAutoShow)
57 
58 
59  Q_PROPERTY( int showDelay READ showDelay WRITE setShowDelay)
61 
62 
63  Q_PROPERTY( bool autoHide READ autoHide WRITE setAutoHide)
65 
66 
67  Q_PROPERTY( int hideDelay READ hideDelay WRITE setHideDelay)
69 
70 public:
71  typedef BasePopupWidget Superclass;
72  explicit PopupWidget(QWidget* parent = 0);
73  virtual ~PopupWidget();
74 
75  bool isActive()const;
76  void setActive(bool);
77 
78  bool autoShow()const;
81  void setAutoShow(bool);
82 
83  int showDelay()const;
84  void setShowDelay(int delay);
85 
86  bool autoHide()const;
90  void setAutoHide(bool autoHide);
91 
92  int hideDelay()const;
93  void setHideDelay(int delay);
94 
95 public Q_SLOTS:
99  void pinPopup(bool pin);
100 
101 public:
103  virtual void hidePopup();
104 
105 protected:
106  virtual void leaveEvent(QEvent* event);
107  virtual void enterEvent(QEvent* event);
108  virtual bool eventFilter(QObject* obj, QEvent* event);
109 
113  virtual void setBaseWidget(QWidget* baseWidget);
114 
115 protected Q_SLOTS:
116  void updatePopup();
117  virtual void onEffectFinished();
118 
119 private:
120  Q_DECLARE_PRIVATE(PopupWidget);
121  Q_DISABLE_COPY(PopupWidget);
122 };
123 
124 #endif
virtual void hidePopup()
Definition: basePopupWidget.cpp:766
Definition: basePopupWidget.h:45
Definition: popupWidget_p.h:40
Definition: popupWidget.h:41