itom
Loading...
Searching...
No Matches
popupWidget.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität 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 für 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
38
41class ITOMWIDGETS_EXPORT PopupWidget : public BasePopupWidget
42{
43 Q_OBJECT
44
52 Q_PROPERTY( bool active READ isActive WRITE setActive)
53
54
56 Q_PROPERTY( bool autoShow READ autoShow WRITE setAutoShow)
57
60 Q_PROPERTY( int showDelay READ showDelay WRITE setShowDelay)
61
64 Q_PROPERTY( bool autoHide READ autoHide WRITE setAutoHide)
65
68 Q_PROPERTY( int hideDelay READ hideDelay WRITE setHideDelay)
69
70public:
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
95public Q_SLOTS:
99 void pinPopup(bool pin);
100
101public:
103 virtual void hidePopup();
104
105protected:
106 virtual void leaveEvent(QEvent* event);
107#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
108 virtual void enterEvent(QEnterEvent* event);
109#else
110 virtual void enterEvent(QEvent* event);
111#endif
112 virtual bool eventFilter(QObject* obj, QEvent* event);
113
117 virtual void setBaseWidget(QWidget* baseWidget);
118
119protected Q_SLOTS:
120 void updatePopup();
121 virtual void onEffectFinished();
122
123private:
124 Q_DECLARE_PRIVATE(PopupWidget);
125 Q_DISABLE_COPY(PopupWidget);
126};
127
128#endif
Definition basePopupWidget.h:46
Definition popupWidget.h:42
Definition popupWidget_p.h:42