Class showing a widget as popup window. More...
#include <vwidgetpopup.h>
Public Slots | |
void | Show (QPoint coord) |
Public Member Functions | |
VWidgetPopup (QWidget *parent=nullptr) | |
void | SetWidget (QWidget *widget, bool own=true) |
QWidget * | Widget () const |
bool | isOwned () const |
int | GetLifeTime () const |
void | SetLifeTime (int value) |
Static Public Member Functions | |
static void | PopupMessage (QWidget *w, const QString &msg) |
Protected Attributes | |
QWidget * | mWidget |
bool | mOwn |
QWidget * | mOldParent |
int | lifeTime |
Class showing a widget as popup window.
setWidget() function allows you to specify the widget to be popped up. After widget is set, you normally should call show() slot in order to pop the widget up at the specified global position.
VWidgetPopup takes care about positioning of your widget on the screen so it will be always visible even if popped beside.
Definition at line 71 of file vwidgetpopup.h.
|
explicit |
Constructor.
If parent not specified (default), then popup widget gets attribute Qt::WA_DeleteOnClose and will be deleted after close.
Definition at line 72 of file vwidgetpopup.cpp.
Referenced by PopupMessage().
|
inline |
Definition at line 124 of file vwidgetpopup.h.
References lifeTime.
|
inline |
Returns true if widget is owned by this popup widget, false otherwise.
Definition at line 118 of file vwidgetpopup.h.
References mOwn.
|
static |
Definition at line 117 of file vwidgetpopup.cpp.
References SCASSERT, SetLifeTime(), SetWidget(), Show(), and VWidgetPopup().
Referenced by MainWindow::SyncMeasurements().
|
inline |
void VWidgetPopup::SetWidget | ( | QWidget * | widget, |
bool | own = true |
||
) |
Sets widget to be popped up to widget. If own is true then the widget will be reparented to the popup widget.
Definition at line 87 of file vwidgetpopup.cpp.
References mOldParent, mOwn, and mWidget.
Referenced by PopupMessage().
|
slot |
Pops up the widget at global coordinates coord.
Definition at line 133 of file vwidgetpopup.cpp.
References lifeTime.
Referenced by PopupMessage().
|
inline |
|
protected |
Definition at line 108 of file vwidgetpopup.h.
Referenced by GetLifeTime(), SetLifeTime(), and Show().
|
protected |
Definition at line 107 of file vwidgetpopup.h.
Referenced by SetWidget().
|
protected |
Definition at line 106 of file vwidgetpopup.h.
Referenced by isOwned(), and SetWidget().
|
protected |
Definition at line 105 of file vwidgetpopup.h.
Referenced by SetWidget(), and Widget().