KMessageWidget Class Reference
from PyKDE4.kdeui import *
Inherits: QFrame → QWidget → QObject
Detailed Description
A widget to provide feedback or propose opportunistic interactions.
KMessageWidget can be used to provide inline positive or negative feedback, or to implement opportunistic interactions.
As a feedback widget, KMessageWidget provides a less intrusive alternative to "OK Only" message boxes. If you do not need the modalness of KMessageBox, consider using KMessageWidget instead.
Negative feedback
The KMessageWidget can be used as a secondary indicator of failure: the first indicator is usually the fact the action the user expected to happen did not happen.
Example: User fills a form, clicks "Submit".
When used to provide negative feedback, KMessageWidget should be placed close to its context. In the case of a form, it should appear on top of the form entries.
KMessageWidget should get inserted in the existing layout. Space should not be reserved for it, otherwise it becomes "dead space", ignored by the user. KMessageWidget should also not appear as an overlay to prevent blocking access to elements the user needs to interact with to fix the failure.
Positive feedback
KMessageWidget can be used for positive feedback but it shouldn't be overused. It is often enough to provide feedback by simply showing the results of an action.
Examples of acceptable uses:
Example of inadapted uses:
Opportunistic interaction
Opportunistic interaction is the situation where the application suggests to the user an action he could be interested in perform, either based on an action the user just triggered or an event which the application noticed.
Example of acceptable uses:
- Since:
- 4.7
Enumerations | |
MessageType | { Positive, Information, Warning, Error } |
Methods | |
__init__ (self, QWidget parent=0) | |
__init__ (self, QString text, QWidget parent=0) | |
addAction (self, QAction action) | |
animatedHide (self) | |
animatedShow (self) | |
bool | event (self, QEvent event) |
int | heightForWidth (self, int width) |
bool | isCloseButtonVisible (self) |
KMessageWidget.MessageType | messageType (self) |
QSize | minimumSizeHint (self) |
paintEvent (self, QPaintEvent event) | |
removeAction (self, QAction action) | |
resizeEvent (self, QResizeEvent event) | |
setCloseButtonVisible (self, bool visible) | |
setMessageType (self, KMessageWidget.MessageType type) | |
setText (self, QString text) | |
setWordWrap (self, bool wordWrap) | |
showEvent (self, QShowEvent event) | |
QSize | sizeHint (self) |
QString | text (self) |
bool | wordWrap (self) |
Method Documentation
__init__ | ( | self, | ||
QWidget | parent=0 | |||
) |
Constructs a KMessageWidget with the specified parent.
__init__ | ( | self, | ||
QString | text, | |||
QWidget | parent=0 | |||
) |
addAction | ( | self, | ||
QAction | action | |||
) |
animatedHide | ( | self ) |
Hide the widget using an animation, unless KGlobalSettings.graphicsEffectLevel() does not allow simple effects.
animatedShow | ( | self ) |
Show the widget using an animation, unless KGlobalSettings.graphicsEffectLevel() does not allow simple effects.
bool event | ( | self, | ||
QEvent | event | |||
) |
int heightForWidth | ( | self, | ||
int | width | |||
) |
bool isCloseButtonVisible | ( | self ) |
KMessageWidget.MessageType messageType | ( | self ) |
QSize minimumSizeHint | ( | self ) |
paintEvent | ( | self, | ||
QPaintEvent | event | |||
) |
removeAction | ( | self, | ||
QAction | action | |||
) |
resizeEvent | ( | self, | ||
QResizeEvent | event | |||
) |
setCloseButtonVisible | ( | self, | ||
bool | visible | |||
) |
setMessageType | ( | self, | ||
KMessageWidget.MessageType | type | |||
) |
setText | ( | self, | ||
QString | text | |||
) |
setWordWrap | ( | self, | ||
bool | wordWrap | |||
) |
showEvent | ( | self, | ||
QShowEvent | event | |||
) |
QSize sizeHint | ( | self ) |
QString text | ( | self ) |
bool wordWrap | ( | self ) |
Enumeration Documentation
MessageType |
- Enumerator:
-
PlainMessage InfoMessage WarningMessage ErrorMessage