summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-29 01:00:22 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-29 01:00:22 +0200
commit4a54e8fd821651079a53f4adc831efd6b1ba9bc7 (patch)
tree32dfcf43aa554a9e235a37a831e366b68bcaafa3 /src
parente092b32922ef650d49167aaf48f9d33190191f9f (diff)
parent9f1a1e320c118ec84d389aaf83008bf01521ce6f (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfile.cpp14
-rw-r--r--src/corelib/io/qprocess.cpp1
-rw-r--r--src/corelib/serialization/qcborstream.cpp1
-rw-r--r--src/gui/configure.json2
-rw-r--r--src/gui/configure.pri11
-rw-r--r--src/gui/opengl/qopengldebug.cpp2
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp5
-rw-r--r--src/network/kernel/qhostinfo.cpp11
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp22
9 files changed, 38 insertions, 31 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index ef97d67653..37de4450cc 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -844,10 +844,16 @@ QFile::copy(const QString &newName)
error = true;
}
}
- if (!error && !out.rename(newName)) {
- error = true;
- close();
- d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName));
+
+ if (!error) {
+ // Sync to disk if possible. Ignore errors (e.g. not supported).
+ d->fileEngine->syncToDisk();
+
+ if (!out.rename(newName)) {
+ error = true;
+ close();
+ d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName));
+ }
}
#ifdef QT_NO_TEMPORARYFILE
if (error)
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index c7635cc7b4..642393955b 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -776,6 +776,7 @@ void QProcessPrivate::Channel::clear()
/*!
\class QProcess::CreateProcessArguments
+ \inmodule QtCore
\note This struct is only available on the Windows platform.
This struct is a representation of all parameters of the Windows API
diff --git a/src/corelib/serialization/qcborstream.cpp b/src/corelib/serialization/qcborstream.cpp
index 1392b4d8d6..078c14a32d 100644
--- a/src/corelib/serialization/qcborstream.cpp
+++ b/src/corelib/serialization/qcborstream.cpp
@@ -1456,6 +1456,7 @@ bool QCborStreamWriter::endMap()
/*!
\class QCborStreamReader::StringResult
+ \inmodule QtCore
This class is returned by readString() and readByteArray(), with either the
contents of the string that was read or an indication that the parsing is
diff --git a/src/gui/configure.json b/src/gui/configure.json
index a4ea4375d1..d7c0da4640 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -445,7 +445,7 @@
],
"sources": [
{ "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" },
- { "type": "openglMakeSpec" }
+ { "type": "makeSpec", "spec": "OPENGL" }
]
},
"opengl_es2": {
diff --git a/src/gui/configure.pri b/src/gui/configure.pri
index 0db106597e..1b95449a10 100644
--- a/src/gui/configure.pri
+++ b/src/gui/configure.pri
@@ -15,17 +15,6 @@ defineTest(qtConfLibrary_freetype) {
return(true)
}
-defineTest(qtConfLibrary_openglMakeSpec) {
- darwin:sdk {
- sysrootified =
- for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
- QMAKE_INCDIR_OPENGL = $$sysrootified
- }
- $${1}.spec = OPENGL
- !qtConfLibrary_makeSpec($$1, $$2): return(false)
- return(true)
-}
-
# Check for Direct X shader compiler 'fxc'.
# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in
diff --git a/src/gui/opengl/qopengldebug.cpp b/src/gui/opengl/qopengldebug.cpp
index 2e628a2bd5..9f1bb76869 100644
--- a/src/gui/opengl/qopengldebug.cpp
+++ b/src/gui/opengl/qopengldebug.cpp
@@ -1366,7 +1366,7 @@ bool QOpenGLDebugLogger::initialize()
#define GET_DEBUG_PROC_ADDRESS(procName) \
d->procName = reinterpret_cast< qt_ ## procName ## _t >( \
- d->context->getProcAddress(#procName) \
+ d->context->getProcAddress(d->context->isOpenGLES() ? (#procName "KHR") : (#procName)) \
);
GET_DEBUG_PROC_ADDRESS(glDebugMessageControl);
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 2e1a2b5bff..bed0a2c450 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -145,6 +145,9 @@ struct QTextLayoutStruct {
inline QFixed absoluteY() const
{ return frameY + y; }
+ inline QFixed contentHeight() const
+ { return pageHeight - pageBottomMargin - pageTopMargin; }
+
inline int currentPage() const
{ return pageHeight == 0 ? 0 : (absoluteY() / pageHeight).truncate(); }
@@ -2701,7 +2704,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
getLineHeightParams(blockFormat, line, scaling, &lineAdjustment, &lineBreakHeight, &lineHeight, &lineBottom);
while (layoutStruct->pageHeight > 0 && layoutStruct->absoluteY() + lineBreakHeight > layoutStruct->pageBottom &&
- layoutStruct->pageHeight >= lineBreakHeight) {
+ layoutStruct->contentHeight() >= lineBreakHeight) {
layoutStruct->newPage();
floatMargins(layoutStruct->y, layoutStruct, &left, &right);
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index 71d1aae35a..d3fe85f5d5 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -137,8 +137,7 @@ void emit_results_ready(const QHostInfo &hostInfo, const QObject *receiver,
\inmodule QtNetwork
\ingroup network
- QHostInfo uses the lookup mechanisms provided by the operating
- system to find the IP address(es) associated with a host name,
+ QHostInfo finds the IP address(es) associated with a host name,
or the host name associated with an IP address.
The class provides two static convenience functions: one that
works asynchronously and emits a signal once the host is found,
@@ -173,6 +172,11 @@ void emit_results_ready(const QHostInfo &hostInfo, const QObject *receiver,
To retrieve the name of the local host, use the static
QHostInfo::localHostName() function.
+ QHostInfo uses the mechanisms provided by the operating system
+ to perform the lookup. As per {https://tools.ietf.org/html/rfc6724}{RFC 6724}
+ there is no guarantee that all IP addresses registered for a domain or
+ host will be returned.
+
\note Since Qt 4.6.1 QHostInfo is using multiple threads for DNS lookup
instead of one dedicated DNS thread. This improves performance,
but also changes the order of signal emissions when using lookupHost()
@@ -180,7 +184,8 @@ void emit_results_ready(const QHostInfo &hostInfo, const QObject *receiver,
\note Since Qt 4.6.3 QHostInfo is using a small internal 60 second DNS cache
for performance improvements.
- \sa QAbstractSocket, {http://www.rfc-editor.org/rfc/rfc3492.txt}{RFC 3492}
+ \sa QAbstractSocket, {http://www.rfc-editor.org/rfc/rfc3492.txt}{RFC 3492},
+ {https://tools.ietf.org/html/rfc6724}{RFC 6724}
*/
static int nextId()
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index 00d011ccec..20a8117304 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -184,9 +184,11 @@ static HCURSOR createBitmapCursor(const QCursor &cursor, qreal scaleFactor = 1)
return createBitmapCursor(bbits, mbits, cursor.hotSpot(), invb, invm);
}
-static QSize systemCursorSize(const QPlatformScreen *screen = nullptr)
+static QSize systemCursorSize() { return QSize(GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR)); }
+
+static QSize screenCursorSize(const QPlatformScreen *screen = nullptr)
{
- const QSize primaryScreenCursorSize(GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR));
+ const QSize primaryScreenCursorSize = systemCursorSize();
if (screen) {
// Correct the size if the DPI value of the screen differs from
// that of the primary screen.
@@ -212,7 +214,7 @@ static inline QSize standardCursorSize() { return QSize(32, 32); }
// createBitmapCursor() only work for standard sizes (32,48,64...), which does
// not work when scaling the 16x16 openhand cursor bitmaps to 150% (resulting
// in a non-standard 24x24 size).
-static QWindowsCursor::PixmapCursor createPixmapCursorFromData(const QSize &systemCursorSize,
+static QWindowsCursor::PixmapCursor createPixmapCursorFromData(const QSize &screenCursorSize,
// The cursor size the bitmap is targeted for
const QSize &bitmapTargetCursorSize,
// The actual size of the bitmap data
@@ -222,7 +224,7 @@ static QWindowsCursor::PixmapCursor createPixmapCursorFromData(const QSize &syst
QPixmap rawImage = QPixmap::fromImage(QBitmap::fromData(QSize(bitmapSize, bitmapSize), bits).toImage());
rawImage.setMask(QBitmap::fromData(QSize(bitmapSize, bitmapSize), maskBits));
- const qreal factor = qreal(systemCursorSize.width()) / qreal(bitmapTargetCursorSize.width());
+ const qreal factor = qreal(screenCursorSize.width()) / qreal(bitmapTargetCursorSize.width());
// Scale images if the cursor size is significantly different, starting with 150% where the system cursor
// size is 48.
if (qAbs(factor - 1.0) > 0.4) {
@@ -402,13 +404,13 @@ QWindowsCursor::PixmapCursor QWindowsCursor::customCursor(Qt::CursorShape cursor
switch (cursorShape) {
case Qt::SplitVCursor:
- return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 32, vsplit_bits, vsplitm_bits);
+ return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 32, vsplit_bits, vsplitm_bits);
case Qt::SplitHCursor:
- return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 32, hsplit_bits, hsplitm_bits);
+ return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 32, hsplit_bits, hsplitm_bits);
case Qt::OpenHandCursor:
- return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 16, openhand_bits, openhandm_bits);
+ return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 16, openhand_bits, openhandm_bits);
case Qt::ClosedHandCursor:
- return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 16, closedhand_bits, closedhandm_bits);
+ return createPixmapCursorFromData(screenCursorSize(screen), standardCursorSize(), 16, closedhand_bits, closedhandm_bits);
case Qt::DragCopyCursor:
return QWindowsCursor::PixmapCursor(QPixmap(copyDragCursorXpmC), QPoint(0, 0));
case Qt::DragMoveCursor:
@@ -454,7 +456,7 @@ QWindowsCursor::PixmapCursor QWindowsCursor::customCursor(Qt::CursorShape cursor
{ Qt::DragLinkCursor, 64, "draglinkcursor_64.png", 0, 0 }
};
- const QSize cursorSize = systemCursorSize(screen);
+ const QSize cursorSize = screenCursorSize(screen);
const QWindowsCustomPngCursor *sEnd = pngCursors + sizeof(pngCursors) / sizeof(pngCursors[0]);
const QWindowsCustomPngCursor *bestFit = nullptr;
int sizeDelta = INT_MAX;
@@ -507,7 +509,7 @@ HCURSOR QWindowsCursor::createCursorFromShape(Qt::CursorShape cursorShape, const
switch (cursorShape) {
case Qt::BlankCursor: {
- QImage blank = QImage(systemCursorSize(screen), QImage::Format_Mono);
+ QImage blank = QImage(systemCursorSize(), QImage::Format_Mono);
blank.fill(0); // ignore color table
return createBitmapCursor(blank, blank);
}