From 8edfc4e9b61d7029e90423b4e5daca87fb5a82b8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 4 May 2016 16:08:37 +0200 Subject: make zlib_dependency auto-add QtCore as a private dep our zlib header includes qglobal.h, so we need the qtcore include dirs, and qtcore is also where the actual code is compiled into. Change-Id: I09f530a1b4e6160438215a6d7223c0771ce94f05 Reviewed-by: Simon Hausmann --- src/3rdparty/zlib_dependency.pri | 4 ++++ src/corelib/tools/tools.pri | 1 + src/tools/bootstrap/bootstrap.pro | 8 ++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/3rdparty/zlib_dependency.pri b/src/3rdparty/zlib_dependency.pri index 0bcb9f9e5e..53e0b3ef39 100644 --- a/src/3rdparty/zlib_dependency.pri +++ b/src/3rdparty/zlib_dependency.pri @@ -7,4 +7,8 @@ contains(QT_CONFIG, system-zlib) { } } else { INCLUDEPATH += $$PWD/zlib + !no_core_dep { + CONFIG += qt + QT_PRIVATE += core + } } diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index ed6afe70ce..bf4c6e2912 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -158,6 +158,7 @@ else:SOURCES += tools/qelapsedtimer_generic.cpp contains(QT_CONFIG, zlib) { include($$PWD/../../3rdparty/zlib.pri) } else { + CONFIG += no_core_dep include($$PWD/../../3rdparty/zlib_dependency.pri) } diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index b3df192110..ae0d581a58 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -132,8 +132,12 @@ macx { ../../corelib/io/qstandardpaths_win.cpp } -if(contains(QT_CONFIG, zlib)|cross_compile):include(../../3rdparty/zlib.pri) -else:include(../../3rdparty/zlib_dependency.pri) +contains(QT_CONFIG, zlib)|cross_compile { + include(../../3rdparty/zlib.pri) +} else { + CONFIG += no_core_dep + include(../../3rdparty/zlib_dependency.pri) +} win32:LIBS += -luser32 -lole32 -ladvapi32 -lshell32 -- cgit v1.2.3 From 45bec92e7a91890dbd40d8d5d310d41a617401e4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 4 May 2016 16:14:50 +0200 Subject: make qt-freetype use qt-zlib when present from the perspective of freetype, this looks like a system zlib. Change-Id: Idb961850b2a92d456cfa2b027bdc85ce5e4be771 Reviewed-by: Simon Hausmann --- src/3rdparty/freetype/freetype.pro | 8 ++++---- src/src.pro | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/3rdparty/freetype/freetype.pro b/src/3rdparty/freetype/freetype.pro index 04aa3b8e18..e16f696372 100644 --- a/src/3rdparty/freetype/freetype.pro +++ b/src/3rdparty/freetype/freetype.pro @@ -64,10 +64,10 @@ win32 { INCLUDEPATH += $$PWD/include DEFINES += FT2_BUILD_LIBRARY -contains(QT_CONFIG, system-zlib) { - DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB - include($$PWD/../zlib_dependency.pri) -} + +DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB +include(../zlib_dependency.pri) + contains(QT_CONFIG, system-png) { DEFINES += FT_CONFIG_OPTION_USE_PNG include($$PWD/../png_dependency.pri) diff --git a/src/src.pro b/src/src.pro index 167133859b..8c18c8d524 100644 --- a/src/src.pro +++ b/src/src.pro @@ -129,7 +129,12 @@ src_plugins.depends = src_sql src_xml src_network src_android.subdir = $$PWD/android # this order is important -contains(QT_CONFIG, zlib)|cross_compile: SUBDIRS += src_qtzlib +contains(QT_CONFIG, zlib)|cross_compile { + SUBDIRS += src_qtzlib + contains(QT_CONFIG, zlib) { + src_3rdparty_freetype.depends += src_corelib + } +} SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc !contains(QT_DISABLED_FEATURES, regularexpression):pcre { SUBDIRS += src_3rdparty_pcre -- cgit v1.2.3 From 4e0b76d810fe370f6a5c6e0242c487f026e809d3 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Fri, 6 May 2016 13:49:01 +0200 Subject: Cocoa integration - avoid dangling menuitem pointer Since QCocoaMenu can live longer than its m_attachedItem pointer, this pointer is becoming invalid after QCocoaMenuItem deleted (and its 'm_native' was released). Task-number: QTBUG-53251 Change-Id: I6d97b75b2c09e2443cd21415c5db94206d5d89ce Reviewed-by: Frederik Gladhorn Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenuitem.mm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 0f422843e0..49f3da48c2 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -110,6 +110,8 @@ QCocoaMenuItem::~QCocoaMenuItem() if (m_merged) { [m_native setHidden:YES]; } else { + if (m_menu && m_menu->attachedItem() == m_native) + m_menu->setAttachedItem(nil); [m_native release]; } -- cgit v1.2.3 From 864380639b9cf563c2399b30f816ed1a25fa3ba6 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 10 May 2016 14:00:18 +0200 Subject: ANGLE: fall back to warp mode in case of standard VGA driver The combination of vendor and device ID being 0000 indicates, that the standard VGA driver is used, and happens when using Qt in a: - Windows 7 machine without proper GPU drivers - Windows 7 machine with disabled GPU - HyperV vm The default driver does neither support D3D9 nor D3D11 properly so that we have to fall back to warp mode for ANGLE. Change-Id: Ia766e32d680c910a50ec3d6b5002892cdb90fdbb Reviewed-by: Maurice Kalinowski Reviewed-by: Laszlo Agocs --- src/plugins/platforms/windows/openglblacklists/default.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json index f7a8844611..1e00da52eb 100644 --- a/src/plugins/platforms/windows/openglblacklists/default.json +++ b/src/plugins/platforms/windows/openglblacklists/default.json @@ -90,6 +90,18 @@ "features": [ "disable_angle" ] + }, + { + "id": 8, + "description": "Standard VGA: Insufficent support for OpenGL, D3D9 and D3D11", + "vendor_id": "0x0000", + "device_id": ["0x0000"], + "os": { + "type": "win" + }, + "features": [ + "disable_desktopgl", "disable_d3d11", "disable_d3d9" + ] } ] } -- cgit v1.2.3 From d8d4129c1b4be6a62ec17d0418ff7a37be451d4c Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 11 May 2016 13:51:54 +0200 Subject: ANGLE: Disable support for shared handles in warp mode on Windows < 8 Shared handles are not supported on Windows 7 and below. If the according flag is set CreateTexture2D will fail with E_OUTOFMEMORY. The check already happens with newer ANGLE versions, which we use in 5.7 but has to happen here as well. Otherwise Qt applications running on Windows 7 and below will crash at startup. Change-Id: I8f539f16dce298611fb1ec7b2f6804d4a04d04e0 Reviewed-by: Maurice Kalinowski --- .../src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp | 13 +++++++ ...le-support-for-shared-handles-in-warp-mod.patch | 44 ++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/angle/patches/0011-ANGLE-Disable-support-for-shared-handles-in-warp-mod.patch (limited to 'src') diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp index 223e2b019b..dd554f4f38 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp @@ -2370,6 +2370,19 @@ unsigned int Renderer11::getReservedFragmentUniformBuffers() const bool Renderer11::getShareHandleSupport() const { + if (mDriverType == D3D_DRIVER_TYPE_WARP) + { +#if !defined(ANGLE_ENABLE_WINDOWS_STORE) + // Warp mode does not support shared handles in Windows versions below Windows 8 + OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}}; + if (GetVersionEx(&result) && + ((result.dwMajorVersion == 6 && result.dwMinorVersion < 2) || result.dwMajorVersion < 6)) + { + // WARP on Windows 7 doesn't support shared handles + return false; + } +#endif // ANGLE_ENABLE_WINDOWS_STORE + } // We only currently support share handles with BGRA surfaces, because // chrome needs BGRA. Once chrome fixes this, we should always support them. // PIX doesn't seem to support using share handles, so disable them. diff --git a/src/angle/patches/0011-ANGLE-Disable-support-for-shared-handles-in-warp-mod.patch b/src/angle/patches/0011-ANGLE-Disable-support-for-shared-handles-in-warp-mod.patch new file mode 100644 index 0000000000..1c4ee1d513 --- /dev/null +++ b/src/angle/patches/0011-ANGLE-Disable-support-for-shared-handles-in-warp-mod.patch @@ -0,0 +1,44 @@ +From db13a9cf7e41207660f080827983655864df802d Mon Sep 17 00:00:00 2001 +From: Oliver Wolff +Date: Wed, 11 May 2016 13:51:54 +0200 +Subject: [PATCH] ANGLE: Disable support for shared handles in warp mode on + Windows < 8 + +Shared handles are not supported on Windows 7 and below. If the +according flag is set CreateTexture2D will fail with E_OUTOFMEMORY. The +check already happens with newer ANGLE versions, which we use in 5.7 +but has to happen here as well. Otherwise Qt applications running on +Windows 7 and below will crash at startup. + +Change-Id: I8f539f16dce298611fb1ec7b2f6804d4a04d04e0 +--- + .../angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp +index 223e2b0..dd554f4 100644 +--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp ++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp +@@ -2370,6 +2370,19 @@ unsigned int Renderer11::getReservedFragmentUniformBuffers() const + + bool Renderer11::getShareHandleSupport() const + { ++ if (mDriverType == D3D_DRIVER_TYPE_WARP) ++ { ++#if !defined(ANGLE_ENABLE_WINDOWS_STORE) ++ // Warp mode does not support shared handles in Windows versions below Windows 8 ++ OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}}; ++ if (GetVersionEx(&result) && ++ ((result.dwMajorVersion == 6 && result.dwMinorVersion < 2) || result.dwMajorVersion < 6)) ++ { ++ // WARP on Windows 7 doesn't support shared handles ++ return false; ++ } ++#endif // ANGLE_ENABLE_WINDOWS_STORE ++ } + // We only currently support share handles with BGRA surfaces, because + // chrome needs BGRA. Once chrome fixes this, we should always support them. + // PIX doesn't seem to support using share handles, so disable them. +-- +2.7.0.windows.1 + -- cgit v1.2.3 From 72e3fcce387d72043dd0b9fbe06d6b720861c1e7 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 10 May 2016 14:54:24 +0200 Subject: Doc: Remove repository name from examplesinstallpath Examples in binary packages now directly match the install path. Change-Id: Ic1487bc766cfd3b0a0a340cc4ae4ba49d953eaa6 Task-number: QTBUG-52953 Reviewed-by: Oswald Buddenhagen --- src/concurrent/doc/qtconcurrent.qdocconf | 2 +- src/corelib/doc/qtcore.qdocconf | 2 +- src/dbus/doc/qtdbus.qdocconf | 2 +- src/gui/doc/qtgui.qdocconf | 2 +- src/network/doc/qtnetwork.qdocconf | 2 +- src/opengl/doc/qtopengl.qdocconf | 2 +- src/platformheaders/doc/qtplatformheaders.qdocconf | 2 +- src/printsupport/doc/qtprintsupport.qdocconf | 2 +- src/sql/doc/qtsql.qdocconf | 2 +- src/testlib/doc/qttestlib.qdocconf | 2 +- src/widgets/doc/qtwidgets.qdocconf | 2 +- src/xml/doc/qtxml.qdocconf | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/concurrent/doc/qtconcurrent.qdocconf b/src/concurrent/doc/qtconcurrent.qdocconf index 3cd2fac075..d8ee963ef5 100644 --- a/src/concurrent/doc/qtconcurrent.qdocconf +++ b/src/concurrent/doc/qtconcurrent.qdocconf @@ -4,7 +4,7 @@ project = QtConcurrent description = Qt Concurrent Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/qtconcurrent +examplesinstallpath = qtconcurrent qhp.projects = QtConcurrent diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index e98f06d47d..3d64708def 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -4,7 +4,7 @@ project = QtCore description = Qt Core Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/corelib +examplesinstallpath = corelib qhp.projects = QtCore diff --git a/src/dbus/doc/qtdbus.qdocconf b/src/dbus/doc/qtdbus.qdocconf index fc8921ff35..ff46cc5961 100644 --- a/src/dbus/doc/qtdbus.qdocconf +++ b/src/dbus/doc/qtdbus.qdocconf @@ -19,7 +19,7 @@ sourcedirs += .. \ ../../../examples/dbus/doc/src excludedirs += ../../../examples/widgets/doc -examplesinstallpath = qtbase/dbus +examplesinstallpath = dbus depends += qtdoc qtcore diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index e34347b801..436e2e0b34 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -4,7 +4,7 @@ project = QtGui description = Qt GUI Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/gui +examplesinstallpath = gui qhp.projects = QtGui diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf index 87e322d6c0..2a8e577dda 100644 --- a/src/network/doc/qtnetwork.qdocconf +++ b/src/network/doc/qtnetwork.qdocconf @@ -4,7 +4,7 @@ project = QtNetwork description = Qt Network Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/network +examplesinstallpath = network qhp.projects = QtNetwork diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf index 3c5fc280bd..6ff6cae2cb 100644 --- a/src/opengl/doc/qtopengl.qdocconf +++ b/src/opengl/doc/qtopengl.qdocconf @@ -21,7 +21,7 @@ imagedirs += images \ depends += qtdoc qtcore qtgui qtwidgets qmake -examplesinstallpath = qtbase/opengl +examplesinstallpath = opengl # The following parameters are for creating a qhp file, the qhelpgenerator # program can convert the qhp file into a qch file which can be opened in diff --git a/src/platformheaders/doc/qtplatformheaders.qdocconf b/src/platformheaders/doc/qtplatformheaders.qdocconf index fc8a9d8731..1c09971e23 100644 --- a/src/platformheaders/doc/qtplatformheaders.qdocconf +++ b/src/platformheaders/doc/qtplatformheaders.qdocconf @@ -4,7 +4,7 @@ project = QtPlatformHeaders description = Qt Platform Headers Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/qtplatformheaders +examplesinstallpath = qtplatformheaders qhp.projects = QtPlatformHeaders diff --git a/src/printsupport/doc/qtprintsupport.qdocconf b/src/printsupport/doc/qtprintsupport.qdocconf index d8fbc23c0a..fbb6f8d1a9 100644 --- a/src/printsupport/doc/qtprintsupport.qdocconf +++ b/src/printsupport/doc/qtprintsupport.qdocconf @@ -4,7 +4,7 @@ project = QtPrintSupport description = Qt Print Support Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/printsupport +examplesinstallpath = printsupport qhp.projects = QtPrintSupport diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf index ceaa75f455..5a224adeb9 100644 --- a/src/sql/doc/qtsql.qdocconf +++ b/src/sql/doc/qtsql.qdocconf @@ -4,7 +4,7 @@ project = QtSql description = Qt SQL Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/sql +examplesinstallpath = sql qhp.projects = QtSql diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf index 72db51b925..0fafc733b1 100644 --- a/src/testlib/doc/qttestlib.qdocconf +++ b/src/testlib/doc/qttestlib.qdocconf @@ -4,7 +4,7 @@ project = QtTestLib description = Qt Test Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/testlib +examplesinstallpath = testlib qhp.projects = QtTestLib diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf index 8160396ca2..f307e9d3e4 100644 --- a/src/widgets/doc/qtwidgets.qdocconf +++ b/src/widgets/doc/qtwidgets.qdocconf @@ -4,7 +4,7 @@ project = QtWidgets description = Qt Widgets Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/widgets +examplesinstallpath = widgets qhp.projects = QtWidgets diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf index b31c2a18d2..a23915487f 100644 --- a/src/xml/doc/qtxml.qdocconf +++ b/src/xml/doc/qtxml.qdocconf @@ -4,7 +4,7 @@ project = QtXml description = Qt XML Reference Documentation version = $QT_VERSION -examplesinstallpath = qtbase/xml +examplesinstallpath = xml qhp.projects = QtXml -- cgit v1.2.3 From d6fbb9070f518443f7ebeb0eae53847814e2496b Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 9 May 2016 16:42:11 +0200 Subject: Doc: Remove references to obsolete reset() function ...from the docs of the signals it emits. Task-number: QTBUG-53228 Change-Id: Ifdd91404cae9dd6480ae29b31f2a48fa024df442 Reviewed-by: Nico Vertriest --- src/corelib/itemmodels/qabstractitemmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 90297b9115..630cdcae98 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -3653,7 +3653,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti \fn QAbstractItemModel::modelAboutToBeReset() \since 4.2 - This signal is emitted when reset() is called, before the model's internal + This signal is emitted when beginResetModel() is called, before the model's internal state (e.g. persistent model indexes) has been invalidated. \sa beginResetModel(), modelReset() @@ -3663,7 +3663,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti \fn QAbstractItemModel::modelReset() \since 4.1 - This signal is emitted when reset() or endResetModel() is called, after the + This signal is emitted when endResetModel() is called, after the model's internal state (e.g. persistent model indexes) has been invalidated. Note that if a model is reset it should be considered that all information -- cgit v1.2.3 From ad54ac5a840c4a31e117fdedd6932ec450441ccc Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 12 May 2016 11:09:03 +0200 Subject: Fix building with -qreal float Min and max expressions need matching types, which means we have to take care both values are qreal. Task-number: QTCREATORBUG-15851 Change-Id: I5f123e979fa896006ff6eafaac1f65b667db975d Reviewed-by: Marc Mutz --- src/gui/painting/qpainter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 62254213f3..1acd84754a 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6268,7 +6268,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const pen.setColor(uc); // Adapt wave to underlineOffset or pen width, whatever is larger, to make it work on all platforms - const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / 2.), pen); + const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / qreal(2.)), pen); const int descent = qFloor(maxHeight); painter->setBrushOrigin(painter->brushOrigin().x(), 0); @@ -6279,7 +6279,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const // the text above it, but limit it to stay within descent. qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5; if (underlineOffset <= fe->descent().toReal()) - adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - 0.5); + adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - qreal(0.5)); const qreal underlinePos = pos.y() + adjustedUnderlineOffset; QColor uc = charFormat.underlineColor(); if (uc.isValid()) -- cgit v1.2.3 From 5316befba2b2f63a4c4a4185a09bc6b149d3f842 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 10 May 2016 16:21:08 +0200 Subject: ICO image format: fix regression in writing when size >= 256 In commit c6c9304, the earlier size limit of 128 was raised to the format's defined maximum of 256. But the required special storage of this size in the image structures was not implemented. Hence, attempting to store such big icons would result in invalid image files. Fix the size storing details, and add some autotests of ico format writing since that was practically uncovered. Task-number: QTBUG-53259 Change-Id: I00e17a04e90c32dcf1124ba5adaf53728fb74dc7 Reviewed-by: Friedemann Kleint --- src/plugins/imageformats/ico/qicohandler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp index 19525397fa..d4dcabeee6 100644 --- a/src/plugins/imageformats/ico/qicohandler.cpp +++ b/src/plugins/imageformats/ico/qicohandler.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE typedef struct { quint8 bWidth; // Width of the image - quint8 bHeight; // Height of the image (times 2) + quint8 bHeight; // Height of the image (actual height, not times 2) quint8 bColorCount; // Number of colors in image (0 if >=8bpp) [ not ture ] quint8 bReserved; // Reserved quint16 wPlanes; // Color Planes @@ -681,8 +681,8 @@ bool ICOReader::write(QIODevice *device, const QVector &images) entries[i].bColorCount = 0; entries[i].bReserved = 0; entries[i].wBitCount = nbits; - entries[i].bHeight = image.height(); - entries[i].bWidth = image.width(); + entries[i].bHeight = image.height() < 256 ? image.height() : 0; // 0 means 256 + entries[i].bWidth = image.width() < 256 ? image.width() : 0; // 0 means 256 entries[i].dwBytesInRes = BMP_INFOHDR_SIZE + (bpl_bmp * image.height()) + (maskImage.bytesPerLine() * maskImage.height()); entries[i].wPlanes = 1; @@ -696,11 +696,11 @@ bool ICOReader::write(QIODevice *device, const QVector &images) bmpHeaders[i].biClrImportant = 0; bmpHeaders[i].biClrUsed = entries[i].bColorCount; bmpHeaders[i].biCompression = 0; - bmpHeaders[i].biHeight = entries[i].bHeight * 2; // 2 is for the mask + bmpHeaders[i].biHeight = entries[i].bHeight ? entries[i].bHeight * 2 : 256 * 2; // 2 is for the mask bmpHeaders[i].biPlanes = entries[i].wPlanes; bmpHeaders[i].biSize = BMP_INFOHDR_SIZE; bmpHeaders[i].biSizeImage = entries[i].dwBytesInRes - BMP_INFOHDR_SIZE; - bmpHeaders[i].biWidth = entries[i].bWidth; + bmpHeaders[i].biWidth = entries[i].bWidth ? entries[i].bWidth : 256; bmpHeaders[i].biXPelsPerMeter = 0; bmpHeaders[i].biYPelsPerMeter = 0; -- cgit v1.2.3 From eba979f6956f8d74bf5a3cb6ed0d585396b790f1 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 18 May 2016 09:59:25 +0200 Subject: WinRT: Do not try to cancel IO for udp sockets on socket close As the functionality is not available for udp sockets trying to call it will cause a crash on socket close. Task-number: QTBUG-53424 Change-Id: Id80b36a248d12bf360135b2374c0a0efdab3a1f0 Reviewed-by: Maurice Kalinowski --- src/network/socket/qnativesocketengine_winrt.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 599f37929c..ecd364b84b 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -458,17 +458,19 @@ void QNativeSocketEngine::close() } #if _MSC_VER >= 1900 - // To close the connection properly (not with a hard reset) all pending read operation have to - // be finished or cancelled. The API isn't available on Windows 8.1 though. - ComPtr socket3; - hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3)); - Q_ASSERT_SUCCEEDED(hr); + if (d->socketType == QAbstractSocket::TcpSocket) { + // To close the connection properly (not with a hard reset) all pending read operation have to + // be finished or cancelled. The API isn't available on Windows 8.1 though. + ComPtr socket3; + hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3)); + Q_ASSERT_SUCCEEDED(hr); - ComPtr action; - hr = socket3->CancelIOAsync(&action); - Q_ASSERT_SUCCEEDED(hr); - hr = QWinRTFunctions::await(action); - Q_ASSERT_SUCCEEDED(hr); + ComPtr action; + hr = socket3->CancelIOAsync(&action); + Q_ASSERT_SUCCEEDED(hr); + hr = QWinRTFunctions::await(action); + Q_ASSERT_SUCCEEDED(hr); + } #endif // _MSC_VER >= 1900 if (d->readOp) { -- cgit v1.2.3