An animation display. More...
#include <klfguiutil.h>
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 |
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 411 of file klfguiutil.h.
KLFWaitAnimationOverlay::KLFWaitAnimationOverlay | ( | QWidget * | parent | ) |
Definition at line 337 of file klfguiutil.cpp.
References setBackgroundColor().
|
virtual |
Definition at line 362 of file klfguiutil.cpp.
QColor KLFWaitAnimationOverlay::backgroundColor | ( | ) | const |
|
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 438 of file klfguiutil.cpp.
References QRect::height(), QSize::height(), KLF_DEBUG_TEE, KLF_FUNC_NAME, klfDbg, QSize::width(), and QRect::width().
Referenced by startWait().
|
inline |
Definition at line 427 of file klfguiutil.h.
|
inline |
Definition at line 428 of file klfguiutil.h.
|
inline |
Definition at line 429 of file klfguiutil.h.
|
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 388 of file klfguiutil.cpp.
References QColor::alpha(), QColor::blue(), QColor::green(), and QColor::red().
Referenced by KLFWaitAnimationOverlay().
|
inlineslot |
|
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 479 of file klfguiutil.h.
|
inlineslot |
Sets the vertical position of this label relative to the parent widget.
Definition at line 484 of file klfguiutil.h.
|
virtualslot |
Set the animation to display while searching (eg. MNG file). See also setWaitMovie(QMovie*).
Definition at line 380 of file klfguiutil.cpp.
References QMovie::setCacheMode(), and setWaitMovie().
|
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 371 of file klfguiutil.cpp.
References QObject::setParent().
Referenced by setWaitMovie().
|
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 460 of file klfguiutil.h.
|
virtualslot |
Display the animation.
Definition at line 395 of file klfguiutil.cpp.
References calcAnimationLabelGeometry(), QMovie::currentPixmap(), QMovie::jumpToFrame(), and QMovie::nextFrameDelay().
|
virtualslot |
Hide the animation.
Definition at line 415 of file klfguiutil.cpp.
|
protectedvirtual |
Definition at line 428 of file klfguiutil.cpp.
References QMovie::currentPixmap(), QMovie::jumpToNextFrame(), and QTimerEvent::timerId().
|
inline |
Definition at line 424 of file klfguiutil.h.
References QMovie::fileName().
|
inline |
Definition at line 426 of file klfguiutil.h.
|
readwrite |
Definition at line 418 of file klfguiutil.h.
|
readwrite |
Definition at line 415 of file klfguiutil.h.
|
readwrite |
Definition at line 416 of file klfguiutil.h.
|
readwrite |
Definition at line 417 of file klfguiutil.h.
|
readwrite |
Definition at line 414 of file klfguiutil.h.
|
readwrite |
Definition at line 414 of file klfguiutil.h.