2015-07-07 00:48:52 +02:00
|
|
|
#ifndef DIALOGS_DIALOGUTILS_H
|
|
|
|
#define DIALOGS_DIALOGUTILS_H
|
|
|
|
|
2016-08-29 15:41:11 +02:00
|
|
|
#include "../global.h"
|
2015-07-07 00:48:52 +02:00
|
|
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
2015-09-26 20:28:30 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QString)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QWidget)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QColor)
|
2023-03-23 23:46:11 +01:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QPalette)
|
2019-05-04 22:16:46 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QPoint)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QRect)
|
2015-07-07 00:48:52 +02:00
|
|
|
|
2019-06-10 21:57:46 +02:00
|
|
|
namespace QtUtilities {
|
2015-07-07 00:48:52 +02:00
|
|
|
|
2016-02-05 20:23:02 +01:00
|
|
|
/*!
|
2017-05-04 22:46:37 +02:00
|
|
|
* \brief The DocumentStatus enum specifies the status of the document in a
|
|
|
|
* window.
|
2016-02-05 20:23:02 +01:00
|
|
|
*/
|
2015-07-07 00:48:52 +02:00
|
|
|
enum class DocumentStatus {
|
2017-05-04 22:46:37 +02:00
|
|
|
NoDocument, /**< There is no document opened. The document path is ignored in
|
|
|
|
this case. */
|
|
|
|
Saved, /**< There is a document opened. All modifications have been saved yet.
|
|
|
|
*/
|
|
|
|
Unsaved /**< There is a document opened and there are unsaved modifications.
|
|
|
|
*/
|
2015-07-07 00:48:52 +02:00
|
|
|
};
|
|
|
|
|
2020-01-29 18:33:27 +01:00
|
|
|
QT_UTILITIES_EXPORT QString generateWindowTitle(DocumentStatus documentStatus, const QString &documentPath);
|
2015-07-07 00:48:52 +02:00
|
|
|
|
2017-05-01 03:16:25 +02:00
|
|
|
#if defined(QT_UTILITIES_GUI_QTWIDGETS) || defined(QT_UTILITIES_GUI_QTQUICK)
|
2023-03-23 23:46:11 +01:00
|
|
|
#ifdef Q_OS_WINDOWS
|
|
|
|
[[deprecated]] QT_UTILITIES_EXPORT QColor windowFrameColor();
|
|
|
|
QT_UTILITIES_EXPORT QColor windowFrameColorForPalette(const QPalette &palette);
|
|
|
|
[[deprecated]] QT_UTILITIES_EXPORT QColor instructionTextColor();
|
|
|
|
QT_UTILITIES_EXPORT QColor instructionTextColorForPalette(const QPalette &palette);
|
2017-05-01 03:16:25 +02:00
|
|
|
#endif
|
2023-03-23 23:46:11 +01:00
|
|
|
[[deprecated]] QT_UTILITIES_EXPORT const QString &dialogStyle();
|
2023-03-26 19:37:13 +02:00
|
|
|
QT_UTILITIES_EXPORT QString dialogStyleForPalette(const QPalette &palette);
|
2017-05-01 03:16:25 +02:00
|
|
|
#ifdef QT_UTILITIES_GUI_QTWIDGETS
|
2020-01-29 18:33:27 +01:00
|
|
|
QT_UTILITIES_EXPORT QRect availableScreenGeometryAtPoint(const QPoint &point);
|
|
|
|
QT_UTILITIES_EXPORT void centerWidget(QWidget *widget, const QWidget *parent = nullptr, const QPoint *position = nullptr);
|
2021-03-24 14:42:56 +01:00
|
|
|
QT_UTILITIES_EXPORT bool centerWidgetAvoidingOverflow(QWidget *widget, const QWidget *parent = nullptr, const QPoint *position = nullptr);
|
2020-01-29 18:33:27 +01:00
|
|
|
QT_UTILITIES_EXPORT void cornerWidget(QWidget *widget, const QPoint *position = nullptr);
|
|
|
|
QT_UTILITIES_EXPORT void makeHeading(QWidget *widget);
|
|
|
|
QT_UTILITIES_EXPORT void updateStyle(QWidget *widget);
|
2017-05-01 03:16:25 +02:00
|
|
|
#endif
|
2015-09-26 20:28:30 +02:00
|
|
|
#endif
|
|
|
|
|
2019-06-10 21:57:46 +02:00
|
|
|
} // namespace QtUtilities
|
2015-07-07 00:48:52 +02:00
|
|
|
|
|
|
|
#endif // DIALOGS_DIALOGUTILS_H
|