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 
58  Q_PROPERTY( bool autoShow READ autoShow WRITE setAutoShow)
61 
62 
63  Q_PROPERTY( int showDelay READ showDelay WRITE setShowDelay)
66 
67 
68  Q_PROPERTY( bool autoHide READ autoHide WRITE setAutoHide)
71 
72 
73  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
ctkPopupWidget::pinPopup
void pinPopup(bool pin)
ctkPopupWidget::setActive
void setActive(bool)
ctkPopupWidget
Definition: ctkPopupWidget.h:44
ctkPopupWidget::autoHide
bool autoHide() const
ctkBasePopupWidget
Definition: ctkBasePopupWidget.h:43
ctkPopupWidget::onEffectFinished
virtual void onEffectFinished()
ctkPopupWidget::setShowDelay
void setShowDelay(int delay)
ctkPopupWidget::~ctkPopupWidget
virtual ~ctkPopupWidget()
ctkPopupWidget::setHideDelay
void setHideDelay(int delay)
ctkPopupWidget::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event)
ctkPopupWidget::enterEvent
virtual void enterEvent(QEvent *event)
ctkPopupWidget::autoShow
bool autoShow() const
ctkPopupWidget::setBaseWidget
virtual void setBaseWidget(QWidget *baseWidget)
ctkPopupWidget::ctkPopupWidget
ctkPopupWidget(QWidget *parent=0)
ctkPopupWidget::updatePopup
void updatePopup()
ctkPopupWidget::Superclass
ctkBasePopupWidget Superclass
Definition: ctkPopupWidget.h:78
ctkPopupWidget::setAutoShow
void setAutoShow(bool)
ctkPopupWidget::hideDelay
int hideDelay() const
ctkPopupWidget::hidePopup
virtual void hidePopup()
Reimplemented for internal reasons.
ctkPopupWidget::leaveEvent
virtual void leaveEvent(QEvent *event)
ctkBasePopupWidget.h
ctkPopupWidget::setAutoHide
void setAutoHide(bool autoHide)
ctkPopupWidget::showDelay
int showDelay() const
ctkPopupWidget::isActive
bool isActive() const