|
swift
|
GUI utilities. More...
#include <guiutility.h>
Static Public Member Functions | |
| static CEnableForFramelessWindow * | mainFramelessEnabledWindow () |
| Main (frameless enabled) application window. | |
| static void | registerMainApplicationWidget (QWidget *mainWidget) |
| Register main application window widget if this is known. | |
| static QWidget * | mainApplicationWidget () |
| Main application window widget. | |
| static qreal | mainApplicationWidgetPixelRatio () |
| Device pixel ratio. | |
| static QSize | desktopSize () |
| Desktop size. | |
| static QSize | physicalScreenSizeOs () |
| Qt independent implementation. | |
| static bool | isMainWindowFrameless () |
| Is main window frameless? | |
| static QString | screenInformation (const QString &separator="\n") |
| Info about screens. | |
| static const QString & | orientationAsString (Qt::ScreenOrientation orientation) |
| Orientation as string. | |
| static QWidgetList | topLevelApplicationWidgetsWithName () |
| Top level widgets with names. | |
| static QPoint | mainWidgetGlobalPosition () |
| Position of main widget. | |
| static QString | replaceTabCountValue (const QString &oldName, int count) |
| Replace count in name such as "stations (4)". | |
| static void | deleteLayout (QLayout *layout, bool deleteWidgets) |
| Delete hierarchy of layouts. | |
| static bool | lenientTitleComparison (const QString &title, const QString &comparison) |
| Lenient / relaxed. | |
| static bool | setComboBoxValueByStartingString (QComboBox *box, const QString &candidate, const QString &unspecified=QString()) |
| Find best match in comboBox. | |
| static bool | setComboBoxValueByContainingString (QComboBox *box, const QString &candidate, const QString &unspecified=QString()) |
| Find best match in comboBox. | |
| static bool | hasSwiftVariantMimeType (const QMimeData *mime) |
| Mime data with swift type. | |
| static swift::misc::CVariant | fromSwiftDragAndDropData (const QMimeData *mime) |
| From text dropped. | |
| static swift::misc::CVariant | fromSwiftDragAndDropData (const QByteArray &utf8Data) |
| From text dropped. | |
| static int | metaTypeIdFromSwiftDragAndDropData (const QMimeData *mime) |
| Meta type id from dropped data. | |
| static QFileInfo | representedMimeFile (const QMimeData *mime) |
| Represented file if any. | |
| static bool | isMimeRepresentingReadableFile (const QMimeData *mime) |
| Is representing existing file. | |
| static bool | isMimeRepresentingReadableJsonFile (const QMimeData *mime) |
| Is representing existing JSON file. | |
| template<class OverlayWidget> | |
| static OverlayWidget * | nextOverlayMessageWidget (QWidget *widget, int maxLevels=10) |
| Find next swift::gui::COverlayMessages QFrame or other implementing widget. | |
| static COverlayMessagesFrame * | nextOverlayMessageFrame (QWidget *widget, int maxLevels=10) |
| Find next COverlayMessagesFrame. | |
| static COverlayMessagesTabWidget * | nextOverlayMessageTabWidget (QWidget *widget, int maxLevels=10) |
| Find next COverlayMessagesTabWidget. | |
| static COverlayMessagesWizardPage * | nextOverlayMessageWizardPage (QWidget *widget, int maxLevels=10) |
| Find next COverlayMessagesWizardPage. | |
| static const QString & | swiftJsonDragAndDropMimeType () |
| Metatype. | |
| static void | checkBoxReadOnly (QCheckBox *checkBox, bool readOnly) |
| Pseudo readonly state for checkbox. | |
| static void | checkBoxesReadOnly (QWidget *parent, bool readOnly) |
| Pseudo readonly state for checkboxes of widget. | |
| static void | tempUnhidePassword (QLineEdit *lineEdit, int unhideMs=5000) |
| Temp. unhide password. | |
| template<class WIDGET> | |
| static void | childrenSetEnabled (QWidget *parent, bool enabled) |
| Enable/disable all child widgets. | |
| static bool | toggleStayOnTop (QWidget *widget) |
| Toggle window flags / stay on top. | |
| static bool | stayOnTop (bool onTop, QWidget *widget) |
| Window flags / stay on top. | |
| static bool | staysOnTop (QWidget *widget) |
| Window on top? | |
| static QTabWidget * | parentTabWidget (QWidget *widget, int maxLevels=5) |
| From a given widget try to find parent tab widget (where widget is embedded). | |
| static QString | marginsToString (const QMargins &margins) |
| Convert to string. | |
| static QMargins | stringToMargins (const QString &str) |
| Convert from string. | |
| static QList< int > | indexToUniqueRows (const QModelIndexList &indexes) |
| Only the row part and unique (so no rows is twice in the list). | |
| static int | clearModel (QAbstractItemModel *model) |
| Clear a model. | |
| static bool | isTopLevelWidget (QWidget *widget) |
| Is top level widget? | |
| static bool | isTopLevelWindow (QWidget *widget) |
| Is top level window? | |
| static void | disableMinMaxCloseButtons (QWidget *window) |
| Disable close button on window. | |
| static QGraphicsOpacityEffect * | fadeInWidget (int durationMs, QWidget *widget, double startValue=0.0, double endValue=1.0) |
| Fade in a widget. | |
| static QGraphicsOpacityEffect * | fadeOutWidget (int durationMs, QWidget *widget, double startValue=1.0, double endValue=0.0) |
| Fade out a widget. | |
| static QFontMetricsF | currentFontMetricsF () |
| Main window font metrics or default metrics. | |
| static QFont | currentFont () |
| Main window font or default font. | |
| static QSizeF | fontMetrics80Chars (bool withRatio=false) |
| 80 characters width/height | |
| static QSizeF | fontMetricsLazyDog43Chars (bool withRatio=false) |
| 43 characters width/height "the quick brown ..." | |
| static QSizeF | fontMetricsEstimateSize (int xCharacters, int yCharacters, bool withRatio=false) |
| Estimate size based on current font. | |
| static void | centerWidget (QWidget *widget) |
| Center widget to host or screen. | |
| static void | centerWidget (QWidget *widget, QWidget *host) |
| Center widget to screen. | |
| static QString | metricsInfo () |
| Some info about font metrics. | |
| static void | forceStyleSheetUpdate (QWidget *widget) |
| Forces a stylesheet update. | |
| static void | superviseMainWindowMinSizes (qreal wRatio=0.85, qreal hRatio=0.85) |
| Make sure that the min.sizes to not exceed the screen resolution. | |
| static QString | asSimpleHtmlImageWidth (const swift::misc::CIcon &icon, int width=-1) |
| CIcon as simple HTML image code segment. | |
| static QString | asSimpleHtmlImageHeight (const swift::misc::CIcon &icon, int height=-1) |
| CIcon as simple HTML image code segment. | |
| static QDialog * | findParentDialog (QWidget *widget) |
| Find parent dialog if there is any, otherwise null. | |
| static QDialog * | findParentDialog (QWidget *widget, int maxLevel) |
| Find parent dialog if there is any, otherwise null. | |
| static void | setElidedText (QLabel *label, const QString &text, Qt::TextElideMode mode=Qt::ElideMiddle) |
| Set elided text. | |
| static void | setElidedText (QLabel *label, const QString &shortText, const QString &longText, Qt::TextElideMode mode=Qt::ElideMiddle) |
| Set elided text. | |
| static void | setWizardButtonWidths (QWizard *wizard) |
| Set button widths for a wizard. | |
| static QWidgetList | getAllModallWidgets () |
| All modal widgets. | |
| static QStringList | getAllWidgetTitles (const QWidgetList &widgets) |
| All titles. | |
| static QStringList | getAllWidgetNames (const QWidgetList &widgets) |
| All names. | |
| static QList< QDockWidget * > | getAllDockWidgets (QWidget *parent, bool floatingOnly) |
| Get all dock widgets. | |
| static QList< QDockWidget * > | getAllDockWidgets (QWindow *parent, bool floatingOnly) |
| Get all dock widgets. | |
| static QWidgetList | closeAllModalWidgets () |
| Close all modal widgets. | |
| static QStringList | closeAllModalWidgetsGetTitles () |
| Close all modal widgets and get titles. | |
| static QList< QDockWidget * > | closeAllDockWidgets (QWidget *parent, bool floatingOnly) |
| Close all dock widgets. | |
| static QList< QDockWidget * > | closeAllDockWidgets (QWindow *parent, bool floatingOnly) |
| Close all dock widgets. | |
| static QStringList | closeAllDockWidgetsGetTitles (QWidget *parent, bool floatingOnly) |
| Close all dock widgets. | |
| static QStringList | closeAllDockWidgetsGetTitles (QWindow *parent, bool floatingOnly) |
| close all dock widgets | |
| static QStringList | deleteLaterAllDockWidgetsGetTitles (QWidget *parent, bool floatingOnly) |
| "deleteLater" all dock widgets | |
| static QString | rectAsString (const QRect &rect) |
| QRect, QSize as string. | |
| static QString | rectAsString (const QRectF &rect) |
| QRect, QSize as string. | |
| static QString | sizeAsString (const QSize &size) |
| QRect, QSize as string. | |
| static QString | sizeAsString (const QSizeF &size) |
| QRect, QSize as string. | |
| static bool | isQMainWindow (const QWidget *widget) |
| Check window type. | |
| static bool | isDialog (const QWidget *widget) |
| Check window type. | |
GUI utilities.
Definition at line 49 of file guiutility.h.
|
static |
CIcon as simple HTML image code segment.
Definition at line 1020 of file guiutility.cpp.
|
static |
CIcon as simple HTML image code segment.
Definition at line 1008 of file guiutility.cpp.
|
static |
Center widget to host or screen.
Definition at line 938 of file guiutility.cpp.
Center widget to screen.
Definition at line 948 of file guiutility.cpp.
|
static |
Pseudo readonly state for checkboxes of widget.
Definition at line 557 of file guiutility.cpp.
|
static |
Pseudo readonly state for checkbox.
fixme hardcoded stylesheet setting
Definition at line 528 of file guiutility.cpp.
|
inlinestatic |
Enable/disable all child widgets.
Definition at line 185 of file guiutility.h.
|
static |
Clear a model.
Definition at line 794 of file guiutility.cpp.
|
static |
Close all dock widgets.
Definition at line 1288 of file guiutility.cpp.
|
static |
Close all dock widgets.
Definition at line 1302 of file guiutility.cpp.
|
static |
Close all dock widgets.
Definition at line 1316 of file guiutility.cpp.
|
static |
close all dock widgets
Definition at line 1332 of file guiutility.cpp.
|
static |
Close all modal widgets.
Definition at line 1258 of file guiutility.cpp.
|
static |
Close all modal widgets and get titles.
Definition at line 1272 of file guiutility.cpp.
|
static |
Main window font or default font.
Definition at line 895 of file guiutility.cpp.
|
static |
Main window font metrics or default metrics.
Definition at line 893 of file guiutility.cpp.
|
static |
"deleteLater" all dock widgets
Definition at line 1348 of file guiutility.cpp.
|
static |
Delete hierarchy of layouts.
Definition at line 646 of file guiutility.cpp.
|
static |
Desktop size.
Definition at line 126 of file guiutility.cpp.
|
static |
Disable close button on window.
Definition at line 851 of file guiutility.cpp.
|
static |
Fade in a widget.
Definition at line 862 of file guiutility.cpp.
|
static |
Fade out a widget.
Definition at line 878 of file guiutility.cpp.
Find parent dialog if there is any, otherwise null.
Definition at line 1032 of file guiutility.cpp.
Find parent dialog if there is any, otherwise null.
Definition at line 1049 of file guiutility.cpp.
|
static |
80 characters width/height
Definition at line 905 of file guiutility.cpp.
|
static |
Estimate size based on current font.
Definition at line 925 of file guiutility.cpp.
|
static |
43 characters width/height "the quick brown ..."
Definition at line 915 of file guiutility.cpp.
|
static |
Forces a stylesheet update.
Definition at line 985 of file guiutility.cpp.
|
static |
From text dropped.
Definition at line 425 of file guiutility.cpp.
From text dropped.
Definition at line 416 of file guiutility.cpp.
|
static |
Get all dock widgets.
Definition at line 1216 of file guiutility.cpp.
|
static |
Get all dock widgets.
Definition at line 1237 of file guiutility.cpp.
|
static |
All modal widgets.
Definition at line 1167 of file guiutility.cpp.
|
static |
All names.
Definition at line 1202 of file guiutility.cpp.
|
static |
All titles.
Definition at line 1181 of file guiutility.cpp.
|
static |
Mime data with swift type.
Definition at line 411 of file guiutility.cpp.
|
static |
Only the row part and unique (so no rows is twice in the list).
Definition at line 779 of file guiutility.cpp.
|
static |
Check window type.
Definition at line 841 of file guiutility.cpp.
|
static |
Is main window frameless?
Definition at line 196 of file guiutility.cpp.
|
static |
Is representing existing file.
Definition at line 496 of file guiutility.cpp.
|
static |
Is representing existing JSON file.
Definition at line 502 of file guiutility.cpp.
|
static |
Check window type.
Definition at line 831 of file guiutility.cpp.
|
static |
Is top level widget?
Definition at line 809 of file guiutility.cpp.
|
static |
Is top level window?
Definition at line 818 of file guiutility.cpp.
|
static |
Lenient / relaxed.
Definition at line 292 of file guiutility.cpp.
|
static |
Main application window widget.
Definition at line 107 of file guiutility.cpp.
|
static |
Device pixel ratio.
Definition at line 116 of file guiutility.cpp.
|
static |
Main (frameless enabled) application window.
Definition at line 55 of file guiutility.cpp.
|
static |
Position of main widget.
Definition at line 610 of file guiutility.cpp.
Convert to string.
Definition at line 753 of file guiutility.cpp.
|
static |
Meta type id from dropped data.
Definition at line 451 of file guiutility.cpp.
|
static |
Some info about font metrics.
Definition at line 966 of file guiutility.cpp.
|
static |
Find next COverlayMessagesFrame.
Definition at line 513 of file guiutility.cpp.
|
static |
Find next COverlayMessagesTabWidget.
Definition at line 518 of file guiutility.cpp.
|
inlinestatic |
Find next swift::gui::COverlayMessages QFrame or other implementing widget.
Definition at line 136 of file guiutility.h.
|
static |
Find next COverlayMessagesWizardPage.
Definition at line 523 of file guiutility.cpp.
|
static |
Orientation as string.
Definition at line 240 of file guiutility.cpp.
|
static |
From a given widget try to find parent tab widget (where widget is embedded).
Definition at line 688 of file guiutility.cpp.
|
static |
Qt independent implementation.
Definition at line 183 of file guiutility.cpp.
Definition at line 262 of file guiutility.cpp.
Definition at line 271 of file guiutility.cpp.
|
static |
Register main application window widget if this is known.
Definition at line 102 of file guiutility.cpp.
Replace count in name such as "stations (4)".
Definition at line 627 of file guiutility.cpp.
Represented file if any.
Definition at line 476 of file guiutility.cpp.
Info about screens.
Definition at line 202 of file guiutility.cpp.
|
static |
Find best match in comboBox.
Definition at line 364 of file guiutility.cpp.
|
static |
Find best match in comboBox.
Definition at line 327 of file guiutility.cpp.
|
static |
Set elided text.
Definition at line 1092 of file guiutility.cpp.
|
static |
Set elided text.
Definition at line 1072 of file guiutility.cpp.
|
static |
Set button widths for a wizard.
Definition at line 1129 of file guiutility.cpp.
Definition at line 280 of file guiutility.cpp.
Definition at line 285 of file guiutility.cpp.
|
static |
Window flags / stay on top.
Definition at line 731 of file guiutility.cpp.
|
static |
Window on top?
Definition at line 678 of file guiutility.cpp.
Convert from string.
Definition at line 762 of file guiutility.cpp.
|
static |
Make sure that the min.sizes to not exceed the screen resolution.
Definition at line 994 of file guiutility.cpp.
|
static |
Metatype.
Definition at line 470 of file guiutility.cpp.
|
static |
Temp. unhide password.
Definition at line 570 of file guiutility.cpp.
|
static |
Toggle window flags / stay on top.
Definition at line 709 of file guiutility.cpp.
|
static |
Top level widgets with names.
Definition at line 595 of file guiutility.cpp.