1 #ifndef DIALOGS_DIALOGUTILS_H 2 #define DIALOGS_DIALOGUTILS_H 3 4 #include "../global.h" 5 6 #include <QtGlobal> 7 8 QT_FORWARD_DECLARE_CLASS(QString) QT_FORWARD_DECLARE_CLASS(QWidget)9QT_FORWARD_DECLARE_CLASS(QWidget) 10 QT_FORWARD_DECLARE_CLASS(QColor) 11 QT_FORWARD_DECLARE_CLASS(QPoint) 12 QT_FORWARD_DECLARE_CLASS(QRect) 13 14 namespace QtUtilities { 15 16 /*! 17 * \brief The DocumentStatus enum specifies the status of the document in a 18 * window. 19 */ 20 enum class DocumentStatus { 21 NoDocument, /**< There is no document opened. The document path is ignored in 22 this case. */ 23 Saved, /**< There is a document opened. All modifications have been saved yet. 24 */ 25 Unsaved /**< There is a document opened and there are unsaved modifications. 26 */ 27 }; 28 29 QT_UTILITIES_EXPORT QString generateWindowTitle(DocumentStatus documentStatus, const QString &documentPath); 30 31 #if defined(QT_UTILITIES_GUI_QTWIDGETS) || defined(QT_UTILITIES_GUI_QTQUICK) 32 #ifdef Q_OS_WIN32 33 QT_UTILITIES_EXPORT QColor windowFrameColor(); 34 QT_UTILITIES_EXPORT QColor instructionTextColor(); 35 #endif 36 QT_UTILITIES_EXPORT const QString &dialogStyle(); 37 #ifdef QT_UTILITIES_GUI_QTWIDGETS 38 QT_UTILITIES_EXPORT QRect availableScreenGeometryAtPoint(const QPoint &point); 39 QT_UTILITIES_EXPORT void centerWidget(QWidget *widget, const QWidget *parent = nullptr, const QPoint *position = nullptr); 40 QT_UTILITIES_EXPORT bool centerWidgetAvoidingOverflow(QWidget *widget, const QWidget *parent = nullptr, const QPoint *position = nullptr); 41 QT_UTILITIES_EXPORT void cornerWidget(QWidget *widget, const QPoint *position = nullptr); 42 QT_UTILITIES_EXPORT void makeHeading(QWidget *widget); 43 QT_UTILITIES_EXPORT void updateStyle(QWidget *widget); 44 #endif 45 #endif 46 47 } // namespace QtUtilities 48 49 #endif // DIALOGS_DIALOGUTILS_H 50