CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Loading...
Searching...
No Matches
ctkPopupWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Library: CTK
4
5 Copyright (c) Kitware Inc.
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0.txt
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19=========================================================================*/
20
21#ifndef __ctkPopupWidget_h
22#define __ctkPopupWidget_h
23
24// CTK includes
25#include "ctkBasePopupWidget.h"
26
27class ctkPopupWidgetPrivate;
28
43class CTK_WIDGETS_EXPORT ctkPopupWidget : public ctkBasePopupWidget
44{
45 Q_OBJECT
46
55 Q_PROPERTY( bool active READ isActive WRITE setActive)
56
57
60 Q_PROPERTY( bool autoShow READ autoShow WRITE setAutoShow)
61
65 Q_PROPERTY( int showDelay READ showDelay WRITE setShowDelay)
66
70 Q_PROPERTY( bool autoHide READ autoHide WRITE setAutoHide)
71
75 Q_PROPERTY( int hideDelay READ hideDelay WRITE setHideDelay)
76
77public:
81 explicit ctkPopupWidget(QWidget* parent = 0);
82 virtual ~ctkPopupWidget();
83
84 bool isActive()const;
85 void setActive(bool);
86
87 bool autoShow()const;
90 void setAutoShow(bool);
91
92 int showDelay()const;
93 void setShowDelay(int delay);
94
95 bool autoHide()const;
99 void setAutoHide(bool autoHide);
100
101 int hideDelay()const;
102 void setHideDelay(int delay);
103
104public Q_SLOTS:
108 void pinPopup(bool pin);
109
110public:
112 virtual void hidePopup();
113
114protected:
115 virtual void leaveEvent(QEvent* event);
116 virtual void enterEvent(QEvent* event);
117 virtual bool eventFilter(QObject* obj, QEvent* event);
118
122 virtual void setBaseWidget(QWidget* baseWidget);
123
124protected Q_SLOTS:
125 void updatePopup();
126 virtual void onEffectFinished();
127
128private:
129 Q_DECLARE_PRIVATE(ctkPopupWidget);
130 Q_DISABLE_COPY(ctkPopupWidget);
131};
132
133#endif