Class OverlayMessage#
Overlay a message in capture mode. More...
#include <overlaymessage.h>
Inherits the following classes: QLabel
Public Functions#
Type | Name |
---|---|
OverlayMessage () = delete |
Public Static Functions#
Type | Name |
---|---|
QString | compileFromKeyMap (const QList< QPair< QString, QString >> & map) Compile a message from a set of shortcuts and descriptions. |
void | init (QWidget * parent, const QRect & targetArea) |
OverlayMessage * | instance () |
void | pop () |
void | push (const QString & msg) Push a message to the message stack. |
void | pushKeyMap (const QList< QPair< QString, QString >> & map) |
void | setVisibility (bool visible) |
Detailed Description#
The message must be initialized by calling init
before it can be used. That can be done once per capture session. The class is a singleton.
To change the active message call push
. This will automatically show the widget. Previous messages won't be forgotten and will be reactivated after you call pop
. You can show/hide the message using setVisibility
(this won't push/pop anything).
Note:
You have to make sure that widgets pop the messages they pushed when they are closed, to avoid potential bugs and resource leaks.
Public Functions Documentation#
function OverlayMessage [1/2]#
OverlayMessage::OverlayMessage () = delete
Public Static Functions Documentation#
function compileFromKeyMap#
Compile a message from a set of shortcuts and descriptions.
static QString OverlayMessage::compileFromKeyMap (
const QList< QPair< QString, QString >> & map
)
Parameters:
map
List of (shortcut, description) pairs
function init#
static void OverlayMessage::init (
QWidget * parent,
const QRect & targetArea
)
function instance#
static OverlayMessage * OverlayMessage::instance ()
function pop#
static void OverlayMessage::pop ()
function push#
Push a message to the message stack.
static void OverlayMessage::push (
const QString & msg
)
Parameters:
msg
Message text formatted as rich text
function pushKeyMap#
static void OverlayMessage::pushKeyMap (
const QList< QPair< QString, QString >> & map
)
function setVisibility#
static void OverlayMessage::setVisibility (
bool visible
)