[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Slots | Public Member Functions | Protected Member Functions | Properties
KLFPleaseWaitPopup Class Reference

A popup screen inviting the user to wait. More...

#include <klfguiutil.h>

Inheritance diagram for KLFPleaseWaitPopup:
Inheritance graph
[legend]

List of all members.

Public Slots

virtual void showPleaseWait ()

Public Member Functions

 KLFPleaseWaitPopup (const QString &text, QWidget *callingWidget=NULL, bool alwaysAbove=false)
virtual ~KLFPleaseWaitPopup ()
bool willDisableUi () const
virtual void setDisableUi (bool disableUi)
virtual bool pleaseWaitShown () const
virtual bool wasUserDiscarded () const

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event)
virtual void paintEvent (QPaintEvent *event)

Properties

bool disableUi

Detailed Description

A popup screen inviting the user to wait.

A splashscreen-like widget that appears in the middle of the screen displaying a text inviting the user to wait.

Used in klatexformula for example when changing skins, to invite the user to wait until Qt finished processing the new style sheet rules onto all the widgets.

The popup is closed if the user clicks it. However this works only if GUI events are processed regularly by the caller (which is not the case if for example you use this utility in a function taking much time to execute, and that blocks the GUI)

You may choose to disable the parent widget while this popup is shown, for example to forbid the user from editing any fields while a change is being processed. Enable this option (by default false) with setDisableUi(). If disableUi is set, then the parent widget is disabled when showPleaseWait() is called, and re-enabled again when this popup is destroyed.

See documentation for the constructor KLFPleaseWaitPopup() for an example.

Definition at line 237 of file klfguiutil.h.


Constructor & Destructor Documentation

KLFPleaseWaitPopup::KLFPleaseWaitPopup ( const QString text,
QWidget *  callingWidget = NULL,
bool  alwaysAbove = false 
)

Build a KLFPleaseWaitPopup object. This behaves very much like a regular Qt window widget, like QDialog or splsh screen.

The common use is to create it on the stack, eg.

   void MyWidget::longFunction() {
     KLFPleaseWaitPopup popup(..., this);
     popup.showPleaseWait();
     ... // long execution time code, with if possible regular calls to qApp->processEvents()
   }

If alwaysAbove is TRUE, then the widget will set some window flags that will display it above all other windows. Note that if this widget is displayed and no application events can be delivered (because of a long, GUI-blocking operation), this can be obstrusive as the window will display over all other windows and cannot be closed by clicking into it. If alwaysAbove is FALSE, then the popup will still display above the callingWidget.

Definition at line 165 of file klfguiutil.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and KLFRelativeFont::setRelPointSize().

Definition at line 190 of file klfguiutil.cpp.


Member Function Documentation

void KLFPleaseWaitPopup::mousePressEvent ( QMouseEvent event) [protected, virtual]

Definition at line 223 of file klfguiutil.cpp.

void KLFPleaseWaitPopup::paintEvent ( QPaintEvent event) [protected, virtual]

Definition at line 229 of file klfguiutil.cpp.

virtual bool KLFPleaseWaitPopup::pleaseWaitShown ( ) const [inline, virtual]

Returns TRUE as soon as this widget got its first paint event.

Definition at line 272 of file klfguiutil.h.

Referenced by KLFDelayedPleaseWaitPopup::process().

void KLFPleaseWaitPopup::setDisableUi ( bool  disableUi) [virtual]

If set to TRUE, then calling showPleaseWait() will disable the widget passed to the constructor. The widget is re-enabled when this popup is destroyed.

Default is false.

Definition at line 196 of file klfguiutil.cpp.

References disableUi.

void KLFPleaseWaitPopup::showPleaseWait ( ) [virtual, slot]

Show the "please wait" widget.

Definition at line 201 of file klfguiutil.cpp.

References QSize::height(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and QSize::width().

Referenced by KLFDelayedPleaseWaitPopup::process().

virtual bool KLFPleaseWaitPopup::wasUserDiscarded ( ) const [inline, virtual]

Returns TRUE if the user clicked on the popup to hide it. (The popup is automatically hidden in that case.)

Definition at line 276 of file klfguiutil.h.

bool KLFPleaseWaitPopup::willDisableUi ( ) const [inline]

Definition at line 263 of file klfguiutil.h.


Property Documentation

bool KLFPleaseWaitPopup::disableUi [read, write]

Definition at line 240 of file klfguiutil.h.

Referenced by setDisableUi().


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

Generated by doxygen 1.7.6.1. The KLatexFormula website is hosted on sourceforge.net