[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Slots | Public Member Functions | Protected Member Functions | Properties | List of all members
KLFWaitAnimationOverlay Class Reference

An animation display. More...

#include <klfguiutil.h>

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

Public Slots

virtual void setWaitMovie (QMovie *movie)
 Set which animation to display while searching. More...
 
virtual void setWaitMovie (const QString &file)
 
void setWidthPercent (int widthpercent)
 Sets the width of this label. More...
 
void setHeightPercent (int heightpercent)
 Sets the height of this label. More...
 
void setPositionXPercent (int xpc)
 Sets the horizontal position of this label relative to the parent widget. More...
 
void setPositionYPercent (int ypc)
 Sets the vertical position of this label relative to the parent widget. More...
 
void setBackgroundColor (const QColor &c)
 Set the label background color. More...
 
virtual void startWait ()
 Display the animation. More...
 
virtual void stopWait ()
 Hide the animation. More...
 

Public Member Functions

 KLFWaitAnimationOverlay (QWidget *parent)
 
virtual ~KLFWaitAnimationOverlay ()
 
QString waitMovieFileName () const
 
int widthPercent () const
 
int heightPercent () const
 
int positionXPercent () const
 
int positionYPercent () const
 
QColor backgroundColor () const
 

Protected Member Functions

virtual void timerEvent (QTimerEvent *event)
 
virtual QRect calcAnimationLabelGeometry ()
 

Properties

QString waitMovie
 
int widthPercent
 
int heightPercent
 
int positionXPercent
 
int positionYPercent
 
QColor backgroundColor
 

Detailed Description

An animation display.

This animation widget can be used as an overlay widget (meaning, not positioned within a layout) to indicate the user to be patient.

Note that this label relies on a non-NULL parent widget. (Exception: the parent is only needed in calcAnimationLabelGeometry(); if you need a parentless animation widget, subclass this animation label and reimplement that function to fit your needs without calling the base implemenation of that function).

Definition at line 412 of file klfguiutil.h.

Constructor & Destructor Documentation

◆ KLFWaitAnimationOverlay()

KLFWaitAnimationOverlay::KLFWaitAnimationOverlay ( QWidget *  parent)

Definition at line 338 of file klfguiutil.cpp.

References setBackgroundColor().

◆ ~KLFWaitAnimationOverlay()

KLFWaitAnimationOverlay::~KLFWaitAnimationOverlay ( )
virtual

Definition at line 363 of file klfguiutil.cpp.

References backgroundColor().

Member Function Documentation

◆ backgroundColor()

QColor KLFWaitAnimationOverlay::backgroundColor ( ) const

◆ calcAnimationLabelGeometry()

QRect KLFWaitAnimationOverlay::calcAnimationLabelGeometry ( )
protectedvirtual

Calculate the geometry the label should have, according to current parent geometry. This function is called just before the label is shown.

The returned QRect should be relative to the parent widget.

Definition at line 439 of file klfguiutil.cpp.

References QRect::height(), QSize::height(), KLF_DEBUG_TEE, KLF_FUNC_NAME, klfDbg, QSize::width(), and QRect::width().

Referenced by startWait().

◆ heightPercent()

int KLFWaitAnimationOverlay::heightPercent ( ) const
inline

Definition at line 428 of file klfguiutil.h.

◆ positionXPercent()

int KLFWaitAnimationOverlay::positionXPercent ( ) const
inline

Definition at line 429 of file klfguiutil.h.

◆ positionYPercent()

int KLFWaitAnimationOverlay::positionYPercent ( ) const
inline

Definition at line 430 of file klfguiutil.h.

◆ setBackgroundColor

void KLFWaitAnimationOverlay::setBackgroundColor ( const QColor c)
slot

Set the label background color.

This function will set the label background color. It may contain an alpha value to make the label translucent or semi-translucent.

This function internally sets a style sheet to this label.

Definition at line 389 of file klfguiutil.cpp.

References QColor::alpha(), QColor::blue(), QColor::green(), and QColor::red().

Referenced by KLFWaitAnimationOverlay().

◆ setHeightPercent

void KLFWaitAnimationOverlay::setHeightPercent ( int  heightpercent)
inlineslot

Sets the height of this label.

See setWidthPercent().

Definition at line 466 of file klfguiutil.h.

◆ setPositionXPercent

void KLFWaitAnimationOverlay::setPositionXPercent ( int  xpc)
inlineslot

Sets the horizontal position of this label relative to the parent widget.

The value given is, in percent, the amout of space on the left of this label (relative to parent), with 0% being aligned completely to the left (no space left on the left) and 100% being aligned completely to the right (no space left on the right). 50% will center the label.

The label will never go beyond the parent widget's geometry.

This function has no effect if calcAnimationLabelGeometry() has been reimplemented in a subclass that does not call the base implementation of that function.

See also setPositionYPercent().

Definition at line 480 of file klfguiutil.h.

◆ setPositionYPercent

void KLFWaitAnimationOverlay::setPositionYPercent ( int  ypc)
inlineslot

Sets the vertical position of this label relative to the parent widget.

See setPositionXPercent().

Definition at line 485 of file klfguiutil.h.

◆ setWaitMovie [1/2]

void KLFWaitAnimationOverlay::setWaitMovie ( QMovie movie)
virtualslot

Set which animation to display while searching.

An animation is displayed when performing long searches, to tell the user to be patient. A default animation is provided if you do not call this function. If you give a NULL movie pointer, the animation is unset and disabled.

The ownership of movie is transferred to this search bar object, and will be delete'd when no longer used.

Definition at line 372 of file klfguiutil.cpp.

References QObject::setParent().

Referenced by setWaitMovie().

◆ setWaitMovie [2/2]

void KLFWaitAnimationOverlay::setWaitMovie ( const QString file)
virtualslot

Set the animation to display while searching (eg. MNG file). See also setWaitMovie(QMovie*).

Definition at line 381 of file klfguiutil.cpp.

References QMovie::setCacheMode(), and setWaitMovie().

◆ setWidthPercent

void KLFWaitAnimationOverlay::setWidthPercent ( int  widthpercent)
inlineslot

Sets the width of this label.

Sets the width of the displayed animation, in percent of the parent's width. 50% will occupy half of the parent's width, leaving 25% on each side, while 100% will occupy the full parent width.

This function has no effect if calcAnimationLabelGeometry() has been reimplemented in a subclass that does not call the base implementation of that function.

This function must be called before animation is shown with startWait().

See also setHeightPercent().

Definition at line 461 of file klfguiutil.h.

◆ startWait

void KLFWaitAnimationOverlay::startWait ( )
virtualslot

Display the animation.

Definition at line 396 of file klfguiutil.cpp.

References calcAnimationLabelGeometry(), QMovie::currentPixmap(), QMovie::jumpToFrame(), and QMovie::nextFrameDelay().

◆ stopWait

void KLFWaitAnimationOverlay::stopWait ( )
virtualslot

Hide the animation.

Definition at line 416 of file klfguiutil.cpp.

◆ timerEvent()

void KLFWaitAnimationOverlay::timerEvent ( QTimerEvent event)
protectedvirtual

◆ waitMovieFileName()

QString KLFWaitAnimationOverlay::waitMovieFileName ( ) const
inline

Definition at line 425 of file klfguiutil.h.

◆ widthPercent()

int KLFWaitAnimationOverlay::widthPercent ( ) const
inline

Definition at line 427 of file klfguiutil.h.

Property Documentation

◆ backgroundColor

QColor KLFWaitAnimationOverlay::backgroundColor
readwrite

Definition at line 419 of file klfguiutil.h.

◆ heightPercent

int KLFWaitAnimationOverlay::heightPercent
readwrite

Definition at line 416 of file klfguiutil.h.

◆ positionXPercent

int KLFWaitAnimationOverlay::positionXPercent
readwrite

Definition at line 417 of file klfguiutil.h.

◆ positionYPercent

int KLFWaitAnimationOverlay::positionYPercent
readwrite

Definition at line 418 of file klfguiutil.h.

◆ waitMovie

QString KLFWaitAnimationOverlay::waitMovie
readwrite

Definition at line 415 of file klfguiutil.h.

◆ widthPercent

int KLFWaitAnimationOverlay::widthPercent
readwrite

Definition at line 415 of file klfguiutil.h.


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

Generated by doxygen 1.8.13