Merge remote-tracking branch 'origin/5.6.1' into 5.6
Conflicts: src/network/socket/qnativesocketengine_winrt.cpp Change-Id: I8edb72f8ba958d80c3d7993b3feaaae782ca8d9c
This commit is contained in:
commit
640441882d
@ -1,5 +1,4 @@
|
||||
load(qt_build_config)
|
||||
CONFIG += qt_example_installs
|
||||
CONFIG += warning_clean
|
||||
|
||||
QT_SOURCE_TREE = $$PWD
|
||||
|
2
configure
vendored
2
configure
vendored
@ -4039,7 +4039,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
|
||||
setBootstrapVariable QMAKE_LFLAGS
|
||||
setBootstrapVariable QMAKE_LFLAGS_GCSECTIONS
|
||||
|
||||
if [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
|
||||
if [ "$CFG_DEBUG" = "no" ] || [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
|
||||
setBootstrapVariable QMAKE_CFLAGS_RELEASE
|
||||
setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
|
||||
|
@ -11,9 +11,13 @@
|
||||
lex.variable_out = GENERATED_SOURCES
|
||||
}
|
||||
|
||||
isEmpty(QMAKE_LEXFLAGS_MANGLE):QMAKE_LEXFLAGS_MANGLE = -P${QMAKE_FILE_BASE}
|
||||
QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS
|
||||
!yacc_no_name_mangle:QMAKE_LEXEXTRAFLAGS += $$QMAKE_LEXFLAGS_MANGLE
|
||||
|
||||
contains(QMAKE_LEX, .*flex) {
|
||||
# GNU flex, we can use -o outfile
|
||||
lex.commands = $$QMAKE_LEX $$QMAKE_LEXFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
||||
lex.commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
||||
} else {
|
||||
# stupid POSIX lex, it only generates a file called lex.yy.c
|
||||
# or lex.prefix.c if the -P<prefix> option is active
|
||||
|
@ -71,6 +71,7 @@ CONFIG += \
|
||||
create_prl link_prl \
|
||||
prepare_docs qt_docs_targets \
|
||||
no_private_qt_headers_warning QTDIR_build \
|
||||
qt_example_installs \
|
||||
# Qt modules get compiled without exceptions enabled by default.
|
||||
# However, testcases should be still built with exceptions.
|
||||
exceptions_off testcase_exceptions
|
||||
|
@ -100,6 +100,20 @@ probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
|
||||
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
|
||||
}
|
||||
|
||||
equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
|
||||
!contains(INSTALLS, target) {
|
||||
!install_ok: \
|
||||
error("$$_PRO_FILE_ is lacking an install target.")
|
||||
else: check_examples: \
|
||||
warning("$$_PRO_FILE_ is lacking an install target.")
|
||||
} else: !equals(target.path, $$sources.path) {
|
||||
!install_ok: \
|
||||
error("$$_PRO_FILE_ installs target to unexpected location.")
|
||||
else: check_examples: \
|
||||
warning("$$_PRO_FILE_ installs target to unexpected location.")
|
||||
}
|
||||
}
|
||||
|
||||
!equals(TEMPLATE, subdirs):!compile_examples {
|
||||
TEMPLATE = aux
|
||||
CONFIG -= have_target qt staticlib dll
|
||||
|
@ -13,6 +13,7 @@ load(qt_build_paths)
|
||||
|
||||
TEMPLATE = lib
|
||||
CONFIG -= qt
|
||||
QT = # In case qt is re-added.
|
||||
|
||||
CONFIG -= warning_clean # Don't presume 3rd party code to be clean
|
||||
load(qt_common)
|
||||
|
@ -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.
|
||||
|
8
src/3rdparty/freetype/freetype.pro
vendored
8
src/3rdparty/freetype/freetype.pro
vendored
@ -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)
|
||||
|
4
src/3rdparty/zlib_dependency.pri
vendored
4
src/3rdparty/zlib_dependency.pri
vendored
@ -7,4 +7,8 @@ contains(QT_CONFIG, system-zlib) {
|
||||
}
|
||||
} else {
|
||||
INCLUDEPATH += $$PWD/zlib
|
||||
!no_core_dep {
|
||||
CONFIG += qt
|
||||
QT_PRIVATE += core
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
From db13a9cf7e41207660f080827983655864df802d Mon Sep 17 00:00:00 2001
|
||||
From: Oliver Wolff <oliver.wolff@qt.io>
|
||||
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
|
||||
|
@ -4,7 +4,7 @@ project = QtConcurrent
|
||||
description = Qt Concurrent Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/qtconcurrent
|
||||
examplesinstallpath = qtconcurrent
|
||||
|
||||
qhp.projects = QtConcurrent
|
||||
|
||||
|
@ -4,7 +4,7 @@ project = QtCore
|
||||
description = Qt Core Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/corelib
|
||||
examplesinstallpath = corelib
|
||||
|
||||
qhp.projects = QtCore
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ sourcedirs += .. \
|
||||
../../../examples/dbus/doc/src
|
||||
excludedirs += ../../../examples/widgets/doc
|
||||
|
||||
examplesinstallpath = qtbase/dbus
|
||||
examplesinstallpath = dbus
|
||||
|
||||
depends += qtdoc qtcore
|
||||
|
||||
|
@ -4,7 +4,7 @@ project = QtGui
|
||||
description = Qt GUI Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/gui
|
||||
examplesinstallpath = gui
|
||||
|
||||
qhp.projects = QtGui
|
||||
|
||||
|
@ -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())
|
||||
|
@ -4,7 +4,7 @@ project = QtNetwork
|
||||
description = Qt Network Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/network
|
||||
examplesinstallpath = network
|
||||
|
||||
qhp.projects = QtNetwork
|
||||
|
||||
|
@ -458,22 +458,24 @@ void QNativeSocketEngine::close()
|
||||
}
|
||||
|
||||
#if _MSC_VER >= 1900
|
||||
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
|
||||
HRESULT hr;
|
||||
// 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<IStreamSocket3> socket3;
|
||||
hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
if (d->socketType == QAbstractSocket::TcpSocket) {
|
||||
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
|
||||
HRESULT hr;
|
||||
// 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<IStreamSocket3> socket3;
|
||||
hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
|
||||
ComPtr<IAsyncAction> action;
|
||||
hr = socket3->CancelIOAsync(&action);
|
||||
ComPtr<IAsyncAction> action;
|
||||
hr = socket3->CancelIOAsync(&action);
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
hr = QWinRTFunctions::await(action);
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
return S_OK;
|
||||
});
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
hr = QWinRTFunctions::await(action);
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
return S_OK;
|
||||
});
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
}
|
||||
#endif // _MSC_VER >= 1900
|
||||
|
||||
if (d->readOp) {
|
||||
|
@ -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
|
||||
|
@ -4,7 +4,7 @@ project = QtPlatformHeaders
|
||||
description = Qt Platform Headers Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/qtplatformheaders
|
||||
examplesinstallpath = qtplatformheaders
|
||||
|
||||
qhp.projects = QtPlatformHeaders
|
||||
|
||||
|
@ -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<QImage> &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<QImage> &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;
|
||||
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ project = QtPrintSupport
|
||||
description = Qt Print Support Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/printsupport
|
||||
examplesinstallpath = printsupport
|
||||
|
||||
qhp.projects = QtPrintSupport
|
||||
|
||||
|
@ -4,7 +4,7 @@ project = QtSql
|
||||
description = Qt SQL Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/sql
|
||||
examplesinstallpath = sql
|
||||
|
||||
qhp.projects = QtSql
|
||||
|
||||
|
@ -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
|
||||
|
@ -4,7 +4,7 @@ project = QtTestLib
|
||||
description = Qt Test Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/testlib
|
||||
examplesinstallpath = testlib
|
||||
|
||||
qhp.projects = QtTestLib
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -4,7 +4,7 @@ project = QtWidgets
|
||||
description = Qt Widgets Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/widgets
|
||||
examplesinstallpath = widgets
|
||||
|
||||
qhp.projects = QtWidgets
|
||||
|
||||
|
@ -4,7 +4,7 @@ project = QtXml
|
||||
description = Qt XML Reference Documentation
|
||||
version = $QT_VERSION
|
||||
|
||||
examplesinstallpath = qtbase/xml
|
||||
examplesinstallpath = xml
|
||||
|
||||
qhp.projects = QtXml
|
||||
|
||||
|
@ -64,6 +64,8 @@ private slots:
|
||||
void nextImageDelay();
|
||||
void pngCompression_data();
|
||||
void pngCompression();
|
||||
void write_data();
|
||||
void write();
|
||||
|
||||
private:
|
||||
QString m_IconPath;
|
||||
@ -335,6 +337,51 @@ void tst_QIcoImageFormat::pngCompression()
|
||||
QCOMPARE(image.height(), height);
|
||||
}
|
||||
|
||||
void tst_QIcoImageFormat::write_data()
|
||||
{
|
||||
QTest::addColumn<QSize>("inSize");
|
||||
QTest::addColumn<QSize>("outSize");
|
||||
|
||||
QTest::newRow("64x64") << QSize(64, 64) << QSize(64, 64);
|
||||
QTest::newRow("128x200") << QSize(128, 200) << QSize(128, 200);
|
||||
QTest::newRow("256x256") << QSize(256, 256) << QSize(256, 256);
|
||||
QTest::newRow("400x400") << QSize(400, 400) << QSize(256, 256);
|
||||
}
|
||||
|
||||
void tst_QIcoImageFormat::write()
|
||||
{
|
||||
QFETCH(QSize, inSize);
|
||||
QFETCH(QSize, outSize);
|
||||
|
||||
QImage inImg;
|
||||
{
|
||||
QImageReader reader(m_IconPath + "/valid/Qt.ico");
|
||||
reader.jumpToImage(4);
|
||||
reader.setScaledSize(inSize);
|
||||
inImg = reader.read();
|
||||
QVERIFY(!inImg.isNull());
|
||||
QCOMPARE(inImg.size(), inSize);
|
||||
}
|
||||
|
||||
QBuffer buf;
|
||||
{
|
||||
buf.open(QIODevice::WriteOnly);
|
||||
QImageWriter writer(&buf, "ico");
|
||||
QVERIFY(writer.write(inImg));
|
||||
buf.close();
|
||||
}
|
||||
{
|
||||
buf.open(QIODevice::ReadOnly);
|
||||
QImageReader reader(&buf);
|
||||
QVERIFY(reader.canRead());
|
||||
QCOMPARE(reader.format(), QByteArray("ico"));
|
||||
QImage outImg = reader.read();
|
||||
QVERIFY(!outImg.isNull());
|
||||
QCOMPARE(outImg.size(), outSize);
|
||||
buf.close();
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QIcoImageFormat)
|
||||
#include "tst_qicoimageformat.moc"
|
||||
|
||||
|
BIN
tests/auto/gui/image/qimagewriter/images/App.ico
Normal file
BIN
tests/auto/gui/image/qimagewriter/images/App.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 318 B |
@ -199,6 +199,7 @@ void tst_QImageWriter::writeImage_data()
|
||||
QTest::newRow("PBM: ship63") << QString("ship63.pbm") << true << QByteArray("pbm");
|
||||
QTest::newRow("XBM: gnus") << QString("gnus.xbm") << false << QByteArray("xbm");
|
||||
QTest::newRow("JPEG: beavis") << QString("beavis.jpg") << true << QByteArray("jpeg");
|
||||
QTest::newRow("ICO: App") << QString("App.ico") << true << QByteArray("ico");
|
||||
}
|
||||
|
||||
void tst_QImageWriter::writeImage()
|
||||
@ -260,7 +261,7 @@ void tst_QImageWriter::writeImage2_data()
|
||||
QTest::addColumn<QImage>("image");
|
||||
|
||||
const QStringList formats = QStringList() << "bmp" << "xpm" << "png"
|
||||
<< "ppm"; //<< "jpeg";
|
||||
<< "ppm" << "ico"; //<< "jpeg";
|
||||
QImage image0(70, 70, QImage::Format_ARGB32);
|
||||
image0.fill(QColor(Qt::red).rgb());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user