summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qclipboard.cpp8
-rw-r--r--src/gui/kernel/qscreen.cpp7
-rw-r--r--src/gui/kernel/qsimpledrag.cpp1
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp3
-rw-r--r--src/gui/kernel/qt_gui_pch.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp3
6 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index 771f0fe93d..a76150d91d 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -46,7 +46,9 @@
#include "qvariant.h"
#include "qbuffer.h"
#include "qimage.h"
+#if QT_CONFIG(textcodec)
#include "qtextcodec.h"
+#endif
#include "private/qguiapplication_p.h"
#include <qpa/qplatformintegration.h>
@@ -298,16 +300,16 @@ QString QClipboard::text(QString &subtype, Mode mode) const
const QByteArray rawData = data->data(QLatin1String("text/") + subtype);
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
QTextCodec* codec = QTextCodec::codecForMib(106); // utf-8 is default
if (subtype == QLatin1String("html"))
codec = QTextCodec::codecForHtml(rawData, codec);
else
codec = QTextCodec::codecForUtfText(rawData, codec);
return codec->toUnicode(rawData);
-#else //QT_NO_TEXTCODEC
+#else // textcodec
return rawData;
-#endif //QT_NO_TEXTCODEC
+#endif // textcodec
}
/*!
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index 479e228e27..f208eb02be 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -701,6 +701,11 @@ void QScreenPrivate::updatePrimaryOrientation()
border of the window. If \a height is negative, the function
copies everything to the bottom of the window.
+ The offset and size arguments are specified in device independent
+ pixels. The returned pixmap may be larger than the requested size
+ when grabbing from a high-DPI screen. Call QPixmap::devicePixelRatio()
+ to determine if this is the case.
+
The window system identifier (\c WId) can be retrieved using the
QWidget::winId() function. The rationale for using a window
identifier and not a QWidget, is to enable grabbing of windows
@@ -748,7 +753,7 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height)
QPixmap result =
platformScreen->grabWindow(window, nativePos.x(), nativePos.y(),
nativeSize.width(), nativeSize.height());
- result.setDevicePixelRatio(factor);
+ result.setDevicePixelRatio(result.devicePixelRatio() * factor);
return result;
}
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index a84f873437..2611dc8580 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -44,7 +44,6 @@
#include "qpixmap.h"
#include "qevent.h"
#include "qfile.h"
-#include "qtextcodec.h"
#include "qguiapplication.h"
#include "qpoint.h"
#include "qbuffer.h"
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 574310f554..1a814ec21f 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -319,7 +319,8 @@ void QSurfaceFormat::setStereo(bool enable)
/*!
Returns the number of samples per pixel when multisampling is
- enabled. By default, multisampling is disabled.
+ enabled, or \c -1 when multisampling is disabled. The default
+ return value is \c -1.
\sa setSamples()
*/
diff --git a/src/gui/kernel/qt_gui_pch.h b/src/gui/kernel/qt_gui_pch.h
index db12ba1078..aa5d3f0572 100644
--- a/src/gui/kernel/qt_gui_pch.h
+++ b/src/gui/kernel/qt_gui_pch.h
@@ -63,7 +63,9 @@
#include <qregexp.h>
#include <qstring.h>
#include <qstringlist.h>
+#if QT_CONFIG(textcodec)
#include <qtextcodec.h>
+#endif
#include <qguiapplication.h>
#include <qbitmap.h>
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 67e1283462..5b32405f5e 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -394,6 +394,9 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleMouseEvent, QWindow *window, ulong times
Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods,
Qt::MouseEventSource source)
{
+ Q_ASSERT_X(type != QEvent::MouseButtonDblClick && type != QEvent::NonClientAreaMouseButtonDblClick,
+ "QWindowSystemInterface::handleMouseEvent",
+ "QTBUG-71263: Native double clicks are not implemented.");
auto localPos = QHighDpi::fromNativeLocalPosition(local, window);
auto globalPos = QHighDpi::fromNativePixels(global, window);