swift
|
Our base class for dockable widgets containing some specialized functionality on top of QDockWidget. More...
Signals | |
void | widgetTopLevelChanged (CDockWidget *, bool topLevel) |
Top level has changed for given widget. | |
void | fontSizePlus () |
Font size signals. | |
void | fontSizeMinus () |
Font size signals. | |
Public Member Functions | |
void | setOriginalTitleBar () |
Set original title bar. | |
void | setEmptyTitleBar () |
Set empty title bar (empty widget as title bar) | |
void | setNullTitleBarWidget () |
Set null (nullptr) title bar. | |
const QString & | windowTitleBackup () const |
Window title backup. | |
QString | windowTitleOrBackup () const |
If current window title is empty, use backup. | |
bool | showTitleWhenDocked () const |
Window title when window is docked. | |
bool | isSelected () const |
Selected when tabbed. | |
bool | isWidgetVisible () const |
Is widget visible? Not to be confused with. More... | |
void | allowStatusBar (bool allow) |
Allow a status bar to be displayed. | |
void | showTitleWhenDocked (bool show) |
Show the window title when docked. | |
void | resetWasAlreadyFloating () |
Reset first time floating, marked as never floated before. | |
bool | wasAlreadyFloating () const |
Was widget already floating? | |
void | setPreferredSizeWhenFloating (const QSize &size) |
Size when floating first time. | |
void | setOffsetWhenFloating (const QPoint &point, bool frameless) |
Position offset when floating first time. | |
virtual void | setFrameless (bool frameless) |
Framless. More... | |
void | toggleFloating () |
Toggle floating. | |
void | toggleVisibility () |
Toggle visibility. | |
void | toggleFrameless () |
Toggle frameless mode. | |
void | windowAlwaysOnTop () |
Toggle frameless deferred. More... | |
void | windowNotAlwaysOnTop () |
Window not on top. | |
void | setAlwaysOnTop (bool onTop) |
Set always on top. | |
bool | restoreFromSettings () |
Restore from settings. | |
void | saveCurrentStateToSettings () |
Remember widget state. | |
void | resetSettings () |
Reset margin settings. | |
void | resetPosition () |
Reset window position. | |
void | setWindowTitle (const QString &title) |
Set title and internally keep a backup. | |
void | displayStatusMessage (const swift::misc::CStatusMessage &statusMessage) |
Display status message. | |
void | displayStatusMessages (const swift::misc::CStatusMessageList &statusMessages) |
Display status messages. | |
![]() | |
CEnableForFramelessWindow (WindowMode mode, bool isMainApplicationWindow, const char *framelessPropertyname, QWidget *correspondingWidget) | |
Constructor. More... | |
virtual | ~CEnableForFramelessWindow () |
Destructor. | |
CEnableForFramelessWindow (const CEnableForFramelessWindow &)=delete | |
Copy constructor. | |
CEnableForFramelessWindow & | operator= (const CEnableForFramelessWindow &)=delete |
Copy assignment operator. | |
void | setMode (WindowMode mode) |
Window mode. | |
bool | isFrameless () const |
Frameless? | |
bool | isMainApplicationWindow () const |
Is main application, explicitly set. | |
void | alwaysOnTop (bool onTop) |
Always on top? | |
void | activate () |
Activates the window. | |
QWidget * | getWidget () const |
Corresponding QMainWindow. | |
Static Public Member Functions | |
static const QString & | propertyOuterWidget () |
Value for dynamic property "dockwidget". | |
static const QString & | propertyInnerWidget () |
Value for dynamic property "dockwidget". | |
![]() | |
static WindowMode | stringToWindowMode (const QString &s) |
String to window mode. | |
static const QString & | windowModeToString (WindowMode m) |
String to window mode. | |
Protected Member Functions | |
CDockWidget (QWidget *parent=nullptr) | |
Constructor. | |
CDockWidget (bool allowStatusBar, QWidget *parent=nullptr) | |
Constructor. | |
void | setMargins () |
Set margins from settings. | |
void | setMarginsWhenFloating (const QMargins &margins) |
Margins when window is floating. | |
void | setMarginsWhenFloating (int left, int top, int right, int bottom) |
Margins when window is floating. | |
QMargins | getMarginsWhenFloating () const |
Margins when floating. | |
void | setMarginsWhenFramelessFloating (const QMargins &margins) |
Margins when window is floating (frameless) | |
void | setMarginsWhenFramelessFloating (int left, int top, int right, int bottom) |
Margins when window is floating (frameless) | |
QMargins | getMarginsWhenFramelessFloating () const |
Margins when floating and frameless. | |
void | setMarginsWhenDocked (const QMargins &margins) |
Margins when widget is floating. | |
void | setMarginsWhenDocked (int left, int top, int right, int bottom) |
Margins when widget is floating. | |
QMargins | getMarginsWhenDocked () const |
Margins when docked. | |
void | setAlwaysOnTopFlag (bool onTop) |
Set the on top flag. | |
virtual void | closeEvent (QCloseEvent *event) |
virtual void | paintEvent (QPaintEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | addToContextMenu (QMenu *contextMenu) const |
Contribute to menu. | |
virtual void | initialFloating () |
Widget is initialized by being a floating window for a shot period. More... | |
virtual void | onStyleSheetsChanged () |
Style sheet has changed. | |
![]() | |
virtual void | windowFlagsChanged () |
Can be used as notification if window mode changes. | |
void | addFramelessSizeGripToStatusBar (QStatusBar *statusBar) |
Resize grip handle. | |
void | hideFramelessSizeGripInStatusBar () |
Resize grip handle. | |
void | setWindowAttributes (WindowMode mode) |
Attributes. More... | |
void | setDynamicProperties (bool frameless) |
Set dynamic properties such as frameless. | |
QHBoxLayout * | addFramelessCloseButton (QMenuBar *menuBar) |
Close button for frameless windows. | |
void | toolToNormalWindow () |
Remove tool and add desktop window. | |
void | normalToToolWindow () |
Remove desktop and add tool window. | |
bool | isToolWindow () const |
Tool window. | |
bool | handleMousePressEvent (QMouseEvent *event) |
Mouse press, required for frameless window. | |
bool | handleMouseMoveEvent (QMouseEvent *event) |
Mouse moving, required for frameless window. | |
bool | handleChangeEvent (QEvent *event) |
Mouse window change event. | |
void | showMinimizedModeChecked () |
Check mode and then show minimized. | |
void | showNormalModeChecked () |
Check mode and then show normal. | |
Additional Inherited Members | |
![]() | |
enum | WindowMode { WindowNormal , WindowFrameless , WindowTool } |
Window modes. | |
![]() | |
static Qt::WindowFlags | modeToWindowFlags (WindowMode mode) |
Translate mode. | |
![]() | |
QPoint | m_framelessDragPosition |
position, if moving is handled with frameless window | |
QSize | m_moveSize |
size when moved (in frameless window) | |
QPushButton * | m_framelessCloseButton = nullptr |
close button | |
WindowMode | m_windowMode = WindowNormal |
Window mode,. More... | |
WindowMode | m_originalWindowMode = WindowNormal |
mode when initialized | |
bool | m_isMainApplicationWindow = false |
is this the main application window (only 1)? | |
QWidget * | m_widget = nullptr |
corresponding window or dock widget | |
QSizeGrip * | m_framelessSizeGrip = nullptr |
size grip object | |
QByteArray | m_framelessPropertyName |
property name for frameless widgets | |
int | m_windowFrameSizeW = -1 |
window frame width | |
int | m_windowFrameSizeH = -1 |
window frame height | |
Our base class for dockable widgets containing some specialized functionality on top of QDockWidget.
We currently use dockable widgets either as "info area" or "info bar" dockable widget. Info area widgets reside in an info are and represent a larger piece of information (e.g. all ATC stations, all aircrafts in range). An info bar is meant to be a small info window displaying information about status, menu state etc.
Definition at line 51 of file dockwidget.h.
|
protectedvirtual |
since update to Qt 5.14.1 this kills the window https://discordapp.com/channels/539048679160676382/539846348275449887/691667651285483564 \todo code can be removed AFTER 8-2020 QPointer<CDockWidget> myself(this); QTimer::singleShot(500, this, [ = ] {
if (myself) { myself->close(); } });
Definition at line 337 of file dockwidget.cpp.
|
protectedvirtual |
Widget is initialized by being a floating window for a shot period.
Place where - when overidden - post initializations can take place. The GUI is already initialized, so all widget data are available.
Reimplemented in swift::gui::CDockWidgetInfoBar, and swift::gui::CDockWidgetInfoArea.
Definition at line 413 of file dockwidget.cpp.
bool swift::gui::CDockWidget::isWidgetVisible | ( | ) | const |
Is widget visible? Not to be confused with.
Definition at line 154 of file dockwidget.cpp.
|
protectedvirtual |
Reimplemented from swift::gui::COverlayMessagesBase< QDockWidget >.
Definition at line 372 of file dockwidget.cpp.
|
protectedvirtual |
Definition at line 367 of file dockwidget.cpp.
|
protectedvirtual |
Definition at line 378 of file dockwidget.cpp.
|
protectedvirtual |
Definition at line 360 of file dockwidget.cpp.
|
virtual |
Framless.
Reimplemented from swift::gui::CEnableForFramelessWindow.
Definition at line 191 of file dockwidget.cpp.
void swift::gui::CDockWidget::windowAlwaysOnTop | ( | ) |
Toggle frameless deferred.
void CDockWidget::toggleFramelessDeferred(int delayMs) { QPointer<CDockWidget> myself(this); QTimer::singleShot(delayMs, this, [ = ] { if (myself) { myself->toggleFrameless(); } }); }
Window always on top
Definition at line 278 of file dockwidget.cpp.