CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
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 
27 class ctkPopupWidgetPrivate;
28 
43 class 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 
62 
65  Q_PROPERTY( int showDelay READ showDelay WRITE setShowDelay)
66 
67 
70  Q_PROPERTY( bool autoHide READ autoHide WRITE setAutoHide)
71 
72 
75  Q_PROPERTY( int hideDelay READ hideDelay WRITE setHideDelay)
76 
77 public:
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 
104 public Q_SLOTS:
108  void pinPopup(bool pin);
109 
110 public:
112  virtual void hidePopup();
113 
114 protected:
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 
124 protected Q_SLOTS:
125  void updatePopup();
126  virtual void onEffectFinished();
127 
128 private:
129  Q_DECLARE_PRIVATE(ctkPopupWidget);
130  Q_DISABLE_COPY(ctkPopupWidget);
131 };
132 
133 #endif
virtual void setBaseWidget(QWidget *baseWidget)
virtual bool eventFilter(QObject *obj, QEvent *event)
int hideDelay() const
bool autoHide() const
void setHideDelay(int delay)
void setAutoHide(bool autoHide)
ctkPopupWidget(QWidget *parent=0)
int showDelay() const
virtual ~ctkPopupWidget()
virtual void hidePopup()
Reimplemented for internal reasons.
virtual void leaveEvent(QEvent *event)
ctkBasePopupWidget Superclass
void updatePopup()
virtual void onEffectFinished()
bool autoShow() const
void setAutoShow(bool)
void setActive(bool)
bool isActive() const
void setShowDelay(int delay)
void pinPopup(bool pin)
virtual void enterEvent(QEvent *event)