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

Definition at line 87 of file ctkBasePopupWidget.h.

Member Enumeration Documentation

Enumerator
WindowOpacityFadeEffect 
ScrollEffect 
FadeEffect 

Definition at line 108 of file ctkBasePopupWidget.h.

Enumerator
TopToBottom 
BottomToTop 

Definition at line 150 of file ctkBasePopupWidget.h.

Constructor & Destructor Documentation

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().
virtual ctkBasePopupWidget::~ctkBasePopupWidget ( )
virtual
ctkBasePopupWidget::ctkBasePopupWidget ( ctkBasePopupWidgetPrivate *  pimpl,
QWidget *  parent = 0 
)
explicitprotected

Member Function Documentation

Qt::Alignment ctkBasePopupWidget::alignment ( ) const

Return the alignment property value.

See also
alignment
AnimationEffect ctkBasePopupWidget::animationEffect ( ) const

Return the animationEffect property value.

See also
animationEffect
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()
QEasingCurve::Type ctkBasePopupWidget::easingCurve ( ) const

Return the easingCurve property value.

See also
easingCurve
double ctkBasePopupWidget::effectAlpha ( ) const
protected
int ctkBasePopupWidget::effectDuration ( ) const

Return the effectDuration property value.

See also
effectDuration
QRect ctkBasePopupWidget::effectGeometry ( ) const
protected
virtual bool ctkBasePopupWidget::event ( QEvent *  event)
protectedvirtual
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.

Qt::LayoutDirection ctkBasePopupWidget::horizontalDirection ( ) const

Return the horizontalDirection property value.

See also
horizontalDirection
void ctkBasePopupWidget::onBaseWidgetDestroyed ( )
protectedslot
virtual void ctkBasePopupWidget::onEffectFinished ( )
protectedvirtualslot
Qt::Orientations ctkBasePopupWidget::orientation ( ) const

Return the orientation property value.

See also
orientation
virtual void ctkBasePopupWidget::paintEvent ( QPaintEvent *  )
protectedvirtual
void ctkBasePopupWidget::popupOpened ( bool  open)
signal

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

See also
showPopup(), hidePopup()
void ctkBasePopupWidget::setAlignment ( Qt::Alignment  alignment)

Set the alignment property value.

See also
alignment
void ctkBasePopupWidget::setAnimationEffect ( AnimationEffect  effect)

Set the animationEffect property value.

See also
animationEffect
virtual void ctkBasePopupWidget::setBaseWidget ( QWidget *  baseWidget)
protectedvirtual

Reimplemented in ctkPopupWidget.

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

Set the easingCurve property value.

See also
easingCurve
void ctkBasePopupWidget::setEffectAlpha ( double  alpha)
protectedslot
void ctkBasePopupWidget::setEffectDuration ( int  duration)

Set the effectDuration property value.

See also
effectDuration
void ctkBasePopupWidget::setEffectGeometry ( QRect  geometry)
protectedslot
void ctkBasePopupWidget::setHorizontalDirection ( Qt::LayoutDirection  direction)

Set the horizontalDirection property value.

See also
horizontalDirection
void ctkBasePopupWidget::setOrientation ( Qt::Orientations  orientation)

Set the orientation property value.

See also
orientation
void ctkBasePopupWidget::setVerticalDirection ( VerticalDirection  direction)

Set the verticalDirection property value.

See also
verticalDirection
virtual void ctkBasePopupWidget::showPopup ( )
virtualslot

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

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 ctkBasePopupWidget::verticalDirection ( ) const

Return the verticalDirection property value.

See also
verticalDirection

Member Data Documentation

QScopedPointer<ctkBasePopupWidgetPrivate> ctkBasePopupWidget::d_ptr
protected

Definition at line 187 of file ctkBasePopupWidget.h.

Property Documentation

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 69 of file ctkBasePopupWidget.h.

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 respectively. ScrollEffect by default.

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

Definition at line 55 of file ctkBasePopupWidget.h.

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 63 of file ctkBasePopupWidget.h.

double ctkBasePopupWidget::effectAlpha
readwrite

Definition at line 188 of file ctkBasePopupWidget.h.

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 63 of file ctkBasePopupWidget.h.

QRect ctkBasePopupWidget::effectGeometry
readwrite

Definition at line 189 of file ctkBasePopupWidget.h.

Qt::LayoutDirection ctkBasePopupWidget::horizontalDirection
readwrite

Control where the popup opens horizontally. LeftToRight by default

Definition at line 83 of file ctkBasePopupWidget.h.

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 74 of file ctkBasePopupWidget.h.

ctkBasePopupWidget::VerticalDirection ctkBasePopupWidget::verticalDirection
readwrite

Control where the popup opens vertically. TopToBottom by default

Definition at line 79 of file ctkBasePopupWidget.h.


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