itom 2.2.1
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2016, Institut fuer Technische Optik (ITO), 00005 Universitaet Stuttgart, Germany 00006 00007 This file is part of itom and its software development toolkit (SDK). 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 In addition, as a special exception, the Institut fuer Technische 00015 Optik (ITO) gives you certain additional rights. 00016 These rights are described in the ITO LGPL Exception version 1.0, 00017 which can be found in the file LGPL_EXCEPTION.txt in this package. 00018 00019 itom is distributed in the hope that it will be useful, but 00020 WITHOUT ANY WARRANTY; without even the implied warranty of 00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00022 General Public Licence for more details. 00023 00024 You should have received a copy of the GNU Library General Public License 00025 along with itom. If not, see <http://www.gnu.org/licenses/>. 00026 00027 This file is a port and modified version of the 00028 CTK Common Toolkit (http://www.commontk.org) 00029 *********************************************************************** */ 00030 00031 #ifndef POPUPWIDGET_H 00032 #define POPUPWIDGET_H 00033 00034 // CTK includes 00035 #include "basePopupWidget.h" 00036 00037 class PopupWidgetPrivate; 00038 00041 class ITOMWIDGETS_EXPORT PopupWidget : public BasePopupWidget 00042 { 00043 Q_OBJECT 00044 00052 Q_PROPERTY( bool active READ isActive WRITE setActive) 00053 00054 00055 00056 Q_PROPERTY( bool autoShow READ autoShow WRITE setAutoShow) 00057 00060 Q_PROPERTY( int showDelay READ showDelay WRITE setShowDelay) 00061 00064 Q_PROPERTY( bool autoHide READ autoHide WRITE setAutoHide) 00065 00068 Q_PROPERTY( int hideDelay READ hideDelay WRITE setHideDelay) 00069 00070 public: 00071 typedef BasePopupWidget Superclass; 00072 explicit PopupWidget(QWidget* parent = 0); 00073 virtual ~PopupWidget(); 00074 00075 bool isActive()const; 00076 void setActive(bool); 00077 00078 bool autoShow()const; 00081 void setAutoShow(bool); 00082 00083 int showDelay()const; 00084 void setShowDelay(int delay); 00085 00086 bool autoHide()const; 00090 void setAutoHide(bool autoHide); 00091 00092 int hideDelay()const; 00093 void setHideDelay(int delay); 00094 00095 public Q_SLOTS: 00099 void pinPopup(bool pin); 00100 00101 public: 00103 virtual void hidePopup(); 00104 00105 protected: 00106 virtual void leaveEvent(QEvent* event); 00107 virtual void enterEvent(QEvent* event); 00108 virtual bool eventFilter(QObject* obj, QEvent* event); 00109 00113 virtual void setBaseWidget(QWidget* baseWidget); 00114 00115 protected Q_SLOTS: 00116 void updatePopup(); 00117 virtual void onEffectFinished(); 00118 00119 private: 00120 Q_DECLARE_PRIVATE(PopupWidget); 00121 Q_DISABLE_COPY(PopupWidget); 00122 }; 00123 00124 #endif