CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Properties | List of all members
ctkBasePopupWidget Class Reference

#include <Libs/Widgets/ctkBasePopupWidget.h>

Inheritance diagram for ctkBasePopupWidget:
Inheritance graph
[legend]
Collaboration diagram for ctkBasePopupWidget:
Collaboration graph
[legend]

Public Types

enum  AnimationEffect { WindowOpacityFadeEffect = 0 , ScrollEffect , FadeEffect }
 
typedef QFrame Superclass
 
enum  VerticalDirection { TopToBottom = 1 , BottomToTop = 2 }
 

Public Slots

virtual void hidePopup ()
 
virtual void showPopup ()
 
void showPopup (bool show)
 

Signals

void popupOpened (bool open)
 

Public Member Functions

Qt::Alignment alignment () const
 
AnimationEffect animationEffect () const
 
QWidget * baseWidget () const
 
 ctkBasePopupWidget (QWidget *parent=0)
 
QEasingCurve::Type easingCurve () const
 
int effectDuration () const
 
Qt::LayoutDirection horizontalDirection () const
 
Qt::Orientations orientation () const
 
void setAlignment (Qt::Alignment alignment)
 
void setAnimationEffect (AnimationEffect effect)
 
void setEasingCurve (QEasingCurve::Type easingCurve)
 
void setEffectDuration (int duration)
 
void setHorizontalDirection (Qt::LayoutDirection direction)
 
void setOrientation (Qt::Orientations orientation)
 
void setVerticalDirection (VerticalDirection direction)
 
VerticalDirection verticalDirection () const
 
virtual ~ctkBasePopupWidget ()
 

Protected Slots

void onBaseWidgetDestroyed ()
 
virtual void onEffectFinished ()
 
void setEffectAlpha (double alpha)
 
void setEffectGeometry (QRect geometry)
 

Protected Member Functions

 ctkBasePopupWidget (ctkBasePopupWidgetPrivate *pimpl, QWidget *parent=0)
 
double effectAlpha () const
 
QRect effectGeometry () const
 
virtual bool event (QEvent *event)
 
virtual void paintEvent (QPaintEvent *)
 
virtual void setBaseWidget (QWidget *baseWidget)
 

Protected Attributes

QScopedPointer< ctkBasePopupWidgetPrivate > d_ptr
 

Properties

Qt::Alignment alignment
 
AnimationEffect animationEffect
 
QEasingCurve::Type easingCurve
 
double effectAlpha
 
int effectDuration
 
QRect effectGeometry
 
Qt::LayoutDirection horizontalDirection
 
Qt::Orientations orientation
 
ctkBasePopupWidget::VerticalDirection verticalDirection
 

Detailed Description

ctkBasePopupWidget is a popup that opens under, above or on the side of another widget (baseWidget() or its parent widget by default). The children (widgets and layout) of the popup define of the content of the popup. Different effects can be applied during the opening or closing of the popup. See ctkPopupWidget for an automatic control of its opening and closing.

See also
baseWidget(), animationEffect, ctkPopupWidget

Definition at line 42 of file ctkBasePopupWidget.h.

Member Typedef Documentation

◆ Superclass

Definition at line 90 of file ctkBasePopupWidget.h.

Member Enumeration Documentation

◆ AnimationEffect

Enumerator
WindowOpacityFadeEffect 
ScrollEffect 
FadeEffect 

Definition at line 108 of file ctkBasePopupWidget.h.

◆ VerticalDirection

Enumerator
TopToBottom 
BottomToTop 

Definition at line 150 of file ctkBasePopupWidget.h.

Constructor & Destructor Documentation

◆ ctkBasePopupWidget() [1/2]

ctkBasePopupWidget::ctkBasePopupWidget ( QWidget *  parent = 0)
explicit

Although a popup widget is a top-level widget, if a parent is passed the popup widget will be deleted when that parent is destroyed (as with any other QObject). ctkBasePopupWidget is a top-level widget (Qt::ToolTip), so even if a parent is passed, the popup will display outside the possible parent layout.

See also
baseWidget().

◆ ~ctkBasePopupWidget()

virtual ctkBasePopupWidget::~ctkBasePopupWidget ( )
virtual

◆ ctkBasePopupWidget() [2/2]

ctkBasePopupWidget::ctkBasePopupWidget ( ctkBasePopupWidgetPrivate *  pimpl,
QWidget *  parent = 0 
)
explicitprotected

Member Function Documentation

◆ alignment()

Qt::Alignment ctkBasePopupWidget::alignment ( ) const

Return the alignment property value.

See also
alignment

◆ animationEffect()

AnimationEffect ctkBasePopupWidget::animationEffect ( ) const

Return the animationEffect property value.

See also
animationEffect

◆ baseWidget()

QWidget* ctkBasePopupWidget::baseWidget ( ) const

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

See also
setBaseWidget()

◆ easingCurve()

QEasingCurve::Type ctkBasePopupWidget::easingCurve ( ) const

Return the easingCurve property value.

See also
easingCurve

◆ effectAlpha()

double ctkBasePopupWidget::effectAlpha ( ) const
protected

◆ effectDuration()

int ctkBasePopupWidget::effectDuration ( ) const

Return the effectDuration property value.

See also
effectDuration

◆ effectGeometry()

QRect ctkBasePopupWidget::effectGeometry ( ) const
protected

◆ event()

virtual bool ctkBasePopupWidget::event ( QEvent *  event)
protectedvirtual

◆ hidePopup

virtual void ctkBasePopupWidget::hidePopup ( )
virtualslot

Hide the popup if open or opening. It takes around 300ms for the fading effect to hide the popup.

Reimplemented in ctkPopupWidget.

◆ horizontalDirection()

Qt::LayoutDirection ctkBasePopupWidget::horizontalDirection ( ) const

Return the horizontalDirection property value.

See also
horizontalDirection

◆ onBaseWidgetDestroyed

void ctkBasePopupWidget::onBaseWidgetDestroyed ( )
protectedslot

◆ onEffectFinished

virtual void ctkBasePopupWidget::onEffectFinished ( )
protectedvirtualslot

◆ orientation()

Qt::Orientations ctkBasePopupWidget::orientation ( ) const

Return the orientation property value.

See also
orientation

◆ paintEvent()

virtual void ctkBasePopupWidget::paintEvent ( QPaintEvent *  )
protectedvirtual

◆ popupOpened

void ctkBasePopupWidget::popupOpened ( bool  open)
signal

Fired when the popup finished its animation: opening (true) or closing (false).

See also
showPopup(), hidePopup()

◆ setAlignment()

void ctkBasePopupWidget::setAlignment ( Qt::Alignment  alignment)

Set the alignment property value.

See also
alignment

◆ setAnimationEffect()

void ctkBasePopupWidget::setAnimationEffect ( AnimationEffect  effect)

Set the animationEffect property value.

See also
animationEffect

◆ setBaseWidget()

virtual void ctkBasePopupWidget::setBaseWidget ( QWidget *  baseWidget)
protectedvirtual

Reimplemented in ctkPopupWidget.

◆ setEasingCurve()

void ctkBasePopupWidget::setEasingCurve ( QEasingCurve::Type  easingCurve)

Set the easingCurve property value.

See also
easingCurve

◆ setEffectAlpha

void ctkBasePopupWidget::setEffectAlpha ( double  alpha)
protectedslot

◆ setEffectDuration()

void ctkBasePopupWidget::setEffectDuration ( int  duration)

Set the effectDuration property value.

See also
effectDuration

◆ setEffectGeometry

void ctkBasePopupWidget::setEffectGeometry ( QRect  geometry)
protectedslot

◆ setHorizontalDirection()

void ctkBasePopupWidget::setHorizontalDirection ( Qt::LayoutDirection  direction)

Set the horizontalDirection property value.

See also
horizontalDirection

◆ setOrientation()

void ctkBasePopupWidget::setOrientation ( Qt::Orientations  orientation)

Set the orientation property value.

See also
orientation

◆ setVerticalDirection()

void ctkBasePopupWidget::setVerticalDirection ( VerticalDirection  direction)

Set the verticalDirection property value.

See also
verticalDirection

◆ showPopup [1/2]

virtual void ctkBasePopupWidget::showPopup ( )
virtualslot

Open the popup if closed or closing. It takes around 300ms for the fading effect to open the popup.

◆ showPopup [2/2]

void ctkBasePopupWidget::showPopup ( bool  show)
inlineslot

Show/hide the popup. It can be conveniently linked to a QPushButton signal.

Definition at line 213 of file ctkBasePopupWidget.h.

◆ verticalDirection()

VerticalDirection ctkBasePopupWidget::verticalDirection ( ) const

Return the verticalDirection property value.

See also
verticalDirection

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkBasePopupWidgetPrivate> ctkBasePopupWidget::d_ptr
protected

Definition at line 187 of file ctkBasePopupWidget.h.

Property Documentation

◆ alignment

Qt::Alignment ctkBasePopupWidget::alignment
readwrite

Where is the popup in relation to the BaseWidget To vertically justify, use Qt::AlignTop | Qt::AlignBottom. Qt::AlignJustify | Qt::AlignBottom by default

Definition at line 213 of file ctkBasePopupWidget.h.

◆ animationEffect

AnimationEffect ctkBasePopupWidget::animationEffect
readwrite

This property controls the effect to apply when the popup is being opened or closed. The total duration and the easing curve of the effect are controlled by effectDuration and \easingCurve respectively. ScrollEffect by default.

See also
AnimationEffect, animationEffect(), setAnimationEffect(), effectDuration, easingCurve

Definition at line 213 of file ctkBasePopupWidget.h.

◆ easingCurve

QEasingCurve::Type ctkBasePopupWidget::easingCurve
readwrite

The property controls the behavior of the opening or closing curve of the animation effect. QEasingCurve::InOutQuad by default

See also
easingCurve(), setEasingCurve(), animationEffect, effectDuration

Definition at line 213 of file ctkBasePopupWidget.h.

◆ effectAlpha

double ctkBasePopupWidget::effectAlpha
readwrite

Definition at line 187 of file ctkBasePopupWidget.h.

◆ effectDuration

int ctkBasePopupWidget::effectDuration
readwrite

The property controls the animationEffect duration in ms. If the popup state (open or close) is being changed during the animation, the active animation is stopped and a new animation is being created from the current state (geometry, transparency...) to the new final state. Default to 333ms

See also
effectDuration(), setEffectDuration(), animationEffect, easingCurve

Definition at line 213 of file ctkBasePopupWidget.h.

◆ effectGeometry

QRect ctkBasePopupWidget::effectGeometry
readwrite

Definition at line 187 of file ctkBasePopupWidget.h.

◆ horizontalDirection

Qt::LayoutDirection ctkBasePopupWidget::horizontalDirection
readwrite

Control where the popup opens horizontally. LeftToRight by default

Definition at line 213 of file ctkBasePopupWidget.h.

◆ orientation

Qt::Orientations ctkBasePopupWidget::orientation
readwrite

Direction of the scrolling effect, can be Qt::Vertical, Qt::Horizontal or both Qt::Vertical|Qt::Horizontal. Vertical by default

Definition at line 213 of file ctkBasePopupWidget.h.

◆ verticalDirection

ctkBasePopupWidget::VerticalDirection ctkBasePopupWidget::verticalDirection
readwrite

Control where the popup opens vertically. TopToBottom by default

Definition at line 213 of file ctkBasePopupWidget.h.


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