itom  4.1.0
PopupWidget Class Reference

#include <popupWidget.h>

Inheritance diagram for PopupWidget:
BasePopupWidget

Public Types

typedef BasePopupWidget Superclass
 
- Public Types inherited from BasePopupWidget
enum  AnimationEffect { WindowOpacityFadeEffect = 0, ScrollEffect, FadeEffect }
 
enum  VerticalDirection { TopToBottom = 1, BottomToTop = 2 }
 
typedef QFrame Superclass
 

Public Slots

void pinPopup (bool pin)
 
- Public Slots inherited from BasePopupWidget
virtual void showPopup ()
 
void showPopup (bool show)
 

Public Member Functions

 PopupWidget (QWidget *parent=0)
 
bool isActive () const
 
void setActive (bool)
 
bool autoShow () const
 
void setAutoShow (bool)
 
int showDelay () const
 
void setShowDelay (int delay)
 
bool autoHide () const
 
void setAutoHide (bool autoHide)
 
int hideDelay () const
 
void setHideDelay (int delay)
 
virtual void hidePopup ()
 Reimplemented for internal reasons.
 
- Public Member Functions inherited from BasePopupWidget
 BasePopupWidget (QWidget *parent=0)
 
QWidget * baseWidget () const
 
AnimationEffect animationEffect () const
 
void setAnimationEffect (AnimationEffect effect)
 
int effectDuration () const
 
void setEffectDuration (int duration)
 
QEasingCurve::Type easingCurve () const
 
void setEasingCurve (QEasingCurve::Type easingCurve)
 
Qt::Alignment alignment () const
 
void setAlignment (Qt::Alignment alignment)
 
Qt::Orientations orientation () const
 
void setOrientation (Qt::Orientations orientation)
 
 Q_ENUM (AnimationEffect)
 
 Q_ENUM (VerticalDirection)
 
VerticalDirection verticalDirection () const
 
void setVerticalDirection (VerticalDirection direction)
 
Qt::LayoutDirection horizontalDirection () const
 
void setHorizontalDirection (Qt::LayoutDirection direction)
 

Protected Slots

void updatePopup ()
 
virtual void onEffectFinished ()
 
- Protected Slots inherited from BasePopupWidget
virtual void onEffectFinished ()
 
void setEffectAlpha (double alpha)
 
void setEffectGeometry (QRect geometry)
 
void onBaseWidgetDestroyed ()
 

Protected Member Functions

virtual void leaveEvent (QEvent *event)
 
virtual void enterEvent (QEvent *event)
 
virtual bool eventFilter (QObject *obj, QEvent *event)
 
virtual void setBaseWidget (QWidget *baseWidget)
 
- Protected Member Functions inherited from BasePopupWidget
 BasePopupWidget (BasePopupWidgetPrivate *pimpl, QWidget *parent=0)
 
double effectAlpha () const
 
QRect effectGeometry () const
 
virtual bool event (QEvent *event)
 
virtual void paintEvent (QPaintEvent *)
 

Properties

bool active
 
bool autoShow
 
int showDelay
 
bool autoHide
 
int hideDelay
 
- Properties inherited from BasePopupWidget
AnimationEffect animationEffect
 ScrollEffect by default.
 
int effectDuration
 
QEasingCurve::Type easingCurve
 
Qt::Alignment alignment
 
Qt::Orientations orientation
 
BasePopupWidget::VerticalDirection verticalDirection
 
Qt::LayoutDirection horizontalDirection
 
double effectAlpha
 
QRect effectGeometry
 

Private Member Functions

 Q_DECLARE_PRIVATE (PopupWidget)
 
 Q_DISABLE_COPY (PopupWidget)
 

Additional Inherited Members

- Signals inherited from BasePopupWidget
void popupOpened (bool open)
 
- Protected Attributes inherited from BasePopupWidget
QScopedPointer< BasePopupWidgetPrivated_ptr
 

Detailed Description

Description:

Member Function Documentation

void PopupWidget::onEffectFinished ( )
protectedvirtualslot

restore the AutoShow if needed.

void PopupWidget::pinPopup ( bool  pin)
slot

Convenient function that calls setAutoHide(!pin) and opens the popup if pin is true regardless of the value of AutoShow. It is typically connected with a checkable button to anchor the popup.

void PopupWidget::setAutoHide ( bool  autoHide)

Don't automatically close the popup when leaving the widget. Calling setAutoHide automatically updates the state close the popup if the mouse is not over the popup nor the base widget.

void PopupWidget::setAutoShow ( bool  mode)

Calling setAutoShow automatically updates opens the popup if the cursor is above the popup or the base widget.

void PopupWidget::setBaseWidget ( QWidget *  baseWidget)
protectedvirtual

Widget the popup is attached to. It opens right under baseWidget and if the PopupWidget sizepolicy contains the growFlag/shrinkFlag, it tries to resize itself to fit the same width of baseWidget.

Reimplemented from BasePopupWidget.

Property Documentation

bool PopupWidget::active
readwrite

Control whether the popup listens to the application and baseWidget events and decides if it needs to be permanently or temporarily hidden. You might want to setActive(false) when embedding the popup into a static layout intead of having it top-level (no parent). Consider also removing its windowFlags (Qt::ToolTip | Qt::FramelessWindowHint) and removing the baseWidget. True by default

bool PopupWidget::autoHide
readwrite

Control wether the popup automatically closes when the mouse leaves the widget. True by default

bool PopupWidget::autoShow
readwrite

Control wether the popup automatically opens when the mouse enter the widget. True by default

int PopupWidget::hideDelay
readwrite

Time in ms to wait before closing the popup if autoHide is set. 200ms by default

int PopupWidget::showDelay
readwrite

Time in ms to wait before opening the popup if autoShow is set. 20ms by default


The documentation for this class was generated from the following files: