From 043b8cf2d6435dea0c29c78bbef21f3c7900a798 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sat, 18 Feb 2023 22:15:20 +0100 Subject: [PATCH] [Gui] hotfix for NotificationBox.cpp - master in uncompilable on Windows, see https://github.com/FreeCAD/FreeCAD/pull/8352#issuecomment-1435769625 and we already got reports about this. Thus a hotfix for the meantime. - (the formatting change was automatically done by MSVC according to our clang file) --- src/Gui/NotificationBox.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Gui/NotificationBox.cpp b/src/Gui/NotificationBox.cpp index 53e683db63..f221ba241c 100644 --- a/src/Gui/NotificationBox.cpp +++ b/src/Gui/NotificationBox.cpp @@ -304,17 +304,25 @@ void NotificationBox::showText(const QPoint &pos, const QString &text, int displ } // no label can be reused, create new label: - if (!text.isEmpty()){ - #ifdef Q_OS_WIN32 + if (!text.isEmpty()) { +#ifdef Q_OS_WIN32 // On windows, we can't use the widget as parent otherwise the window will be // raised when the toollabel will be shown QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED - new NotificationLabel(text, pos, QGuiApplication::screenAt(pos), displayTime, minShowTime); // NotificationLabel manages its own lifetime. + new NotificationLabel(text, + pos, + nullptr, + displayTime, + minShowTime);// NotificationLabel manages its own lifetime. QT_WARNING_POP - #else - new NotificationLabel(text, pos, nullptr, displayTime, minShowTime); // sets NotificationLabel::instance to itself - #endif +#else + new NotificationLabel(text, + pos, + nullptr, + displayTime, + minShowTime);// sets NotificationLabel::instance to itself +#endif NotificationLabel::instance->placeNotificationLabel(pos); NotificationLabel::instance->setObjectName(QLatin1String("NotificationBox_label"));