diff options
Diffstat (limited to 'src/plugins')
19 files changed, 72 insertions, 205 deletions
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h index ba3d293e054..41946105f08 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h @@ -1,8 +1,7 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef DMABUFSERVERBUFFERINTEGRATION_H -#define DMABUFSERVERBUFFERINTEGRATION_H +#pragma once #include <QtCore/QVariant> #include <QtWaylandClient/private/qwayland-wayland.h> @@ -106,5 +105,3 @@ void DmaBufServerBufferIntegration::glEGLImageTargetTexture2DOES(GLenum target, } QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h index 01ac4dbe718..68db25dbfc5 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h @@ -1,8 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef DRMEGLSERVERBUFFERINTEGRATION_H -#define DRMEGLSERVERBUFFERINTEGRATION_H +#pragma once #include <QtWaylandClient/private/qwayland-wayland.h> #include <QtCore/QVariant> @@ -101,5 +100,3 @@ void DrmEglServerBufferIntegration::glEGLImageTargetTexture2DOES (GLenum target, } QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h index 4f9e0aeced5..d112fb32385 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h @@ -1,8 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef SHMSERVERBUFFERINTEGRATION_H -#define SHMSERVERBUFFERINTEGRATION_H +#pragma once #include <QtWaylandClient/private/qwayland-wayland.h> #include "qwayland-shm-emulation-server-buffer.h" @@ -50,5 +49,3 @@ private: } QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h index a1c413be5d9..9d86c61a366 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h @@ -1,8 +1,7 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef VULKANSERVERBUFFERINTEGRATION_H -#define VULKANSERVERBUFFERINTEGRATION_H +#pragma once #include <QtWaylandClient/private/qwayland-wayland.h> #include "qwayland-qt-vulkan-server-buffer-unstable-v1.h" @@ -61,5 +60,3 @@ private: } QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h index 9890d14f137..756d139cac1 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h @@ -1,19 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#ifndef QWAYLANDEGLINTEGRATION_H -#define QWAYLANDEGLINTEGRATION_H +#pragma once #include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h> @@ -59,5 +47,3 @@ private: QT_END_NAMESPACE } - -#endif // QWAYLANDEGLINTEGRATION_H diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h index aa45d1b1759..b18c01ac267 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h @@ -1,20 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#ifndef QWAYLANDEGLINCLUDE_H -#define QWAYLANDEGLINCLUDE_H +#pragma once #include <string.h> #include <wayland-client-core.h> @@ -23,5 +10,3 @@ #define EGL_EGLEXT_PROTOTYPES #include <QtGui/private/qt_egl_p.h> - -#endif // QWAYLANDEGLINCLUDE_H diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h index dc2e0319519..863bd7f0e53 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h @@ -1,19 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#ifndef QWAYLANDEGLWINDOW_H -#define QWAYLANDEGLWINDOW_H +#pragma once #include <QtWaylandClient/private/qwaylandwindow_p.h> #include "qwaylandeglinclude_p.h" @@ -72,5 +60,3 @@ private: } QT_END_NAMESPACE - -#endif // QWAYLANDEGLWINDOW_H diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h index 543c31fd727..7ea7019dfe5 100644 --- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h +++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h @@ -1,19 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#ifndef QWAYLANDGLCONTEXT_H -#define QWAYLANDGLCONTEXT_H +#pragma once #include "qwaylandeglinclude_p.h" //must be first @@ -71,5 +59,3 @@ private: } QT_END_NAMESPACE - -#endif // QWAYLANDGLCONTEXT_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h index 006f648e4d6..693c179fe29 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h @@ -1,8 +1,7 @@ // Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDFULLSCREENSHELLV1INTEGRATION_H -#define QWAYLANDFULLSCREENSHELLV1INTEGRATION_H +#pragma once #include <wayland-client-core.h> #include <QtWaylandClient/private/qwayland-wayland.h> @@ -27,5 +26,3 @@ public: } // namespace QtWaylandClient QT_END_NAMESPACE - -#endif // QWAYLANDFULLSCREENSHELLV1INTEGRATION_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h index 0a82e5eee2a..12f551d1031 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h @@ -1,8 +1,7 @@ // Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDFULLSCREENSHELLV1SURFACE_H -#define QWAYLANDFULLSCREENSHELLV1SURFACE_H +#pragma once #include <QtWaylandClient/qtwaylandclientglobal.h> #include <QtWaylandClient/private/qwaylandshellsurface_p.h> @@ -28,5 +27,3 @@ private: } // namespace QtWaylandClient QT_END_NAMESPACE - -#endif // QWAYLANDFULLSCREENSHELLV1SURFACE_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h index e2c54ef0078..fd107f825e1 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h @@ -1,19 +1,7 @@ // Copyright (C) 2020 Aleix Pol Gonzalez <aleixpol@kde.org> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDXDGACTIVATIONV1_P_H -#define QWAYLANDXDGACTIVATIONV1_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#pragma once #include <QObject> #include "qwayland-xdg-activation-v1.h" @@ -55,4 +43,3 @@ public: } // namespace QtWaylandClient QT_END_NAMESPACE -#endif // QWAYLANDXDGACTIVATIONV1_P_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h index 680fcf69b9f..fc2e67b97c4 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h @@ -1,19 +1,7 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDXDGDECORATIONV1_P_H -#define QWAYLANDXDGDECORATIONV1_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#pragma once #include "qwayland-xdg-decoration-unstable-v1.h" @@ -59,4 +47,3 @@ private: } // namespace QtWaylandClient QT_END_NAMESPACE -#endif // QWAYLANDXDGDECORATIONV1_P_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h index f5465a63e6f..27ebc8d5afa 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h @@ -1,8 +1,7 @@ // Copyright (C) 2022 David Reondo <kde@david-redondo.de> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDDIALOGV1_P_H -#define QWAYLANDDIALOGV1_P_H +#pragma once #include <qwayland-xdg-dialog-v1.h> @@ -28,5 +27,3 @@ public: } // namespace QtWaylandClient QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h index c993e390a24..aa48e38c34b 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h @@ -1,19 +1,7 @@ // Copyright (C) 2022 David Reondo <kde@david-redondo.de> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDXDGEXPORTERV2_H -#define QWAYLANDXDGEXPORTERV2_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#pragma once #include <qwayland-xdg-foreign-unstable-v2.h> @@ -45,5 +33,3 @@ public: } QT_END_NAMESPACE - -#endif // QWAYLANDXDGEXPORTERV2_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h index 43c17672c23..bfecff41758 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -2,19 +2,7 @@ // Copyright (C) 2017 Eurogiciel, author: <philippe.coval@eurogiciel.fr> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDXDGSHELL_H -#define QWAYLANDXDGSHELL_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#pragma once #include "qwayland-xdg-shell.h" @@ -204,4 +192,3 @@ private: } // namespace QtWaylandClient QT_END_NAMESPACE -#endif // QWAYLANDXDGSHELL_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h index b7627d80462..82b2e005edd 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h @@ -1,19 +1,7 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDXDGSHELLINTEGRATION_P_H -#define QWAYLANDXDGSHELLINTEGRATION_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#pragma once #include "qwayland-xdg-shell.h" @@ -47,5 +35,3 @@ private: } QT_END_NAMESPACE - -#endif // QWAYLANDXDGSHELLINTEGRATION_P_H diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h index 63e379c4daf..25e06183f2f 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h @@ -2,19 +2,7 @@ // Copyright (C) 2024 David Edmundson <davidedmundson@kde.org> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QWAYLANDTOPLEVELICONV1_P_H -#define QWAYLANDTOPLEVELICONV1_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#pragma once #include "wayland-xdg-shell-client-protocol.h" #include <qwayland-xdg-toplevel-icon-v1.h> @@ -45,8 +33,7 @@ private: QList<int> mPreferredSizes; QWaylandDisplay *mDisplay; }; + } // namespace QtWaylandClient QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp b/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp index e2e46a7b215..55e36b4587a 100644 --- a/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp +++ b/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp @@ -11,6 +11,55 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; +QString QWindowsWindowClassDescription::classNameSuffix(Qt::WindowFlags type, unsigned int style, bool hasIcon) +{ + QString suffix; + + switch (type) { + case Qt::Popup: + suffix += "Popup"_L1; + break; + case Qt::Tool: + suffix += "Tool"_L1; + break; + case Qt::ToolTip: + suffix += "ToolTip"_L1; + break; + default: + break; + } + + if (style & CS_DROPSHADOW) + suffix += "DropShadow"_L1; + if (style & CS_SAVEBITS) + suffix += "SaveBits"_L1; + if (style & CS_OWNDC) + suffix += "OwnDC"_L1; + if (hasIcon) + suffix += "Icon"_L1; + + return suffix; +} + +bool QWindowsWindowClassDescription::computeHasIcon(Qt::WindowFlags flags, Qt::WindowFlags type) +{ + bool hasIcon = true; + + switch (type) { + case Qt::Tool: + case Qt::ToolTip: + case Qt::Popup: + hasIcon = false; + break; + case Qt::Dialog: + if (!(flags & Qt::WindowSystemMenuHint)) + hasIcon = false; // QTBUG-2027, dialogs without system menu. + break; + } + + return hasIcon; +} + QWindowsWindowClassDescription QWindowsWindowClassDescription::fromName(QString name, WNDPROC procedure) { return { std::move(name), procedure }; @@ -27,7 +76,7 @@ QWindowsWindowClassDescription QWindowsWindowClassDescription::fromWindow(const const Qt::WindowFlags type = flags & Qt::WindowType_Mask; // Determine style and icon. description.style = CS_DBLCLKS; - description.hasIcon = true; + description.hasIcon = computeHasIcon(flags, type); // The following will not set CS_OWNDC for any widget window, even if it contains a // QOpenGLWidget or QQuickWidget later on. That cannot be detected at this stage. if (window->surfaceType() == QSurface::OpenGLSurface || (flags & Qt::MSWindowsOwnDC)) @@ -41,36 +90,9 @@ QWindowsWindowClassDescription QWindowsWindowClassDescription::fromWindow(const case Qt::ToolTip: case Qt::Popup: description.style |= CS_SAVEBITS; // Save/restore background - description.hasIcon = false; - break; - case Qt::Dialog: - if (!(flags & Qt::WindowSystemMenuHint)) - description.hasIcon = false; // QTBUG-2027, dialogs without system menu. - break; - } - // Create a unique name for the flag combination - description.name = "QWindow"_L1; - switch (type) { - case Qt::Tool: - description.name += "Tool"_L1; - break; - case Qt::ToolTip: - description.name += "ToolTip"_L1; - break; - case Qt::Popup: - description.name += "Popup"_L1; - break; - default: break; } - if (description.style & CS_DROPSHADOW) - description.name += "DropShadow"_L1; - if (description.style & CS_SAVEBITS) - description.name += "SaveBits"_L1; - if (description.style & CS_OWNDC) - description.name += "OwnDC"_L1; - if (description.hasIcon) - description.name += "Icon"_L1; + description.name = "QWindow"_L1 + classNameSuffix(type, description.style, description.hasIcon); return description; } diff --git a/src/plugins/platforms/windows/qwindowswindowclassdescription.h b/src/plugins/platforms/windows/qwindowswindowclassdescription.h index 3acca65b8a2..78d99b4c525 100644 --- a/src/plugins/platforms/windows/qwindowswindowclassdescription.h +++ b/src/plugins/platforms/windows/qwindowswindowclassdescription.h @@ -25,6 +25,9 @@ struct QWindowsWindowClassDescription bool shouldAddPrefix{ true }; private: + static QString classNameSuffix(Qt::WindowFlags type, unsigned int style, bool hasIcon); + static bool computeHasIcon(Qt::WindowFlags flags, Qt::WindowFlags type); + friend QDebug operator<<(QDebug dbg, const QWindowsWindowClassDescription &description); }; |
