summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qguivariant.cpp15
-rw-r--r--src/gui/kernel/qscreen.cpp6
2 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index c6462dfed7b..6da0c4d387b 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -52,14 +52,13 @@
QT_BEGIN_NAMESPACE
namespace {
-
-// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
struct QVariantGuiHelper : QMetaTypeModuleHelper
{
#define QT_IMPL_METATYPEINTERFACE_GUI_TYPES(MetaTypeName, MetaTypeId, RealName) \
QT_METATYPE_INTERFACE_INIT(RealName),
- const QtPrivate::QMetaTypeInterface *interfaceForType(int type) const override {
+ static const QtPrivate::QMetaTypeInterface *interfaceForType(int type)
+ {
switch (type) {
QT_FOR_EACH_STATIC_GUI_CLASS(QT_METATYPE_CONVERT_ID_TO_TYPE)
default: return nullptr;
@@ -67,7 +66,7 @@ struct QVariantGuiHelper : QMetaTypeModuleHelper
}
#undef QT_IMPL_METATYPEINTERFACE_GUI_TYPES
- bool convert(const void *from, int fromTypeId, void *to, int toTypeId) const override
+ static bool convert(const void *from, int fromTypeId, void *to, int toTypeId)
{
Q_ASSERT(fromTypeId != toTypeId);
@@ -133,14 +132,14 @@ struct QVariantGuiHelper : QMetaTypeModuleHelper
return false;
}
};
-
-static constexpr QVariantGuiHelper qVariantGuiHelper;
-
} // namespace used to hide QVariant handler
void qRegisterGuiVariant()
{
- qMetaTypeGuiHelper = &qVariantGuiHelper;
+ qMetaTypeGuiHelper = QMetaTypeModuleHelper{
+ &QVariantGuiHelper::interfaceForType,
+ &QVariantGuiHelper::convert,
+ };
}
Q_CONSTRUCTOR_FUNCTION(qRegisterGuiVariant)
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index afe6de35305..caf4cb7fe5b 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -34,6 +34,12 @@ QT_BEGIN_NAMESPACE
\note Both physical and logical DPI are expressed in device-independent dots.
Multiply by QScreen::devicePixelRatio() to get device-dependent density.
+ To obtain a QScreen object, use QGuiApplication::primaryScreen() for the
+ primary screen, or QGuiApplication::screens() to get a list of all screens.
+
+ \sa QGuiApplication::primaryScreen()
+ \sa QGuiApplication::screens()
+
\inmodule QtGui
*/