Fix return type of `dialogStyleForPalette()` for Windows implementation
This commit is contained in:
parent
8642f14bb1
commit
121d6a10db
|
@ -95,7 +95,7 @@ QColor instructionTextColor()
|
||||||
* \brief Returns the stylesheet for dialogs and other windows used in my
|
* \brief Returns the stylesheet for dialogs and other windows used in my
|
||||||
* applications.
|
* applications.
|
||||||
*/
|
*/
|
||||||
const QString &dialogStyleForPalette(const QPalette &palette)
|
QString dialogStyleForPalette(const QPalette &palette)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WINDOWS
|
#ifdef Q_OS_WINDOWS
|
||||||
return QStringLiteral("#mainWidget { color: palette(text); background-color: "
|
return QStringLiteral("#mainWidget { color: palette(text); background-color: "
|
||||||
|
@ -109,9 +109,8 @@ const QString &dialogStyleForPalette(const QPalette &palette)
|
||||||
.arg(windowFrameColorForPalette(palette).name(), instructionTextColorForPalette(palette).name());
|
.arg(windowFrameColorForPalette(palette).name(), instructionTextColorForPalette(palette).name());
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(palette)
|
Q_UNUSED(palette)
|
||||||
static const auto style = QStringLiteral("*[classNames~=\"heading\"] { font-weight: bold; }"
|
return QStringLiteral("*[classNames~=\"heading\"] { font-weight: bold; }"
|
||||||
"*[classNames~=\"input-invalid\"] { color: red; }");
|
"*[classNames~=\"input-invalid\"] { color: red; }");
|
||||||
return style;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +120,8 @@ const QString &dialogStyleForPalette(const QPalette &palette)
|
||||||
*/
|
*/
|
||||||
const QString &dialogStyle()
|
const QString &dialogStyle()
|
||||||
{
|
{
|
||||||
return dialogStyleForPalette(QGuiApplication::palette());
|
static const auto style = dialogStyleForPalette(QGuiApplication::palette());
|
||||||
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_UTILITIES_GUI_QTWIDGETS
|
#ifdef QT_UTILITIES_GUI_QTWIDGETS
|
||||||
|
|
|
@ -37,7 +37,7 @@ QT_UTILITIES_EXPORT QColor windowFrameColorForPalette(const QPalette &palette);
|
||||||
QT_UTILITIES_EXPORT QColor instructionTextColorForPalette(const QPalette &palette);
|
QT_UTILITIES_EXPORT QColor instructionTextColorForPalette(const QPalette &palette);
|
||||||
#endif
|
#endif
|
||||||
[[deprecated]] QT_UTILITIES_EXPORT const QString &dialogStyle();
|
[[deprecated]] QT_UTILITIES_EXPORT const QString &dialogStyle();
|
||||||
QT_UTILITIES_EXPORT const QString &dialogStyleForPalette(const QPalette &palette);
|
QT_UTILITIES_EXPORT QString dialogStyleForPalette(const QPalette &palette);
|
||||||
#ifdef QT_UTILITIES_GUI_QTWIDGETS
|
#ifdef QT_UTILITIES_GUI_QTWIDGETS
|
||||||
QT_UTILITIES_EXPORT QRect availableScreenGeometryAtPoint(const QPoint &point);
|
QT_UTILITIES_EXPORT QRect availableScreenGeometryAtPoint(const QPoint &point);
|
||||||
QT_UTILITIES_EXPORT void centerWidget(QWidget *widget, const QWidget *parent = nullptr, const QPoint *position = nullptr);
|
QT_UTILITIES_EXPORT void centerWidget(QWidget *widget, const QWidget *parent = nullptr, const QPoint *position = nullptr);
|
||||||
|
|
Loading…
Reference in New Issue