From e0dc27d791cd2106f661bd3d949281aaf1239990 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 8 Jul 2014 11:01:50 +0200 Subject: Doc: Hide QTextInlineObject constructor from the documentation The constructor takes an internal class instance as a parameter, and is not meant to be used externally. Add a note in the description and hide the constructor. Task-number: QTBUG-39785 Change-Id: Ice850f0968880f3933ebb7ae83efeaeed85441cb Reviewed-by: Konstantin Ritt Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextlayout.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index ede7426ffc..4879ae51d7 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -108,6 +108,10 @@ QT_BEGIN_NAMESPACE This class is only used if the text layout is used to lay out parts of a QTextDocument. + Normally, you do not need to create a QTextInlineObject. It is + used by QAbstractTextDocumentLayout to handle inline objects when + implementing a custom layout. + The inline object has various attributes that can be set, for example using, setWidth(), setAscent(), and setDescent(). The rectangle it occupies is given by rect(), and its direction by @@ -117,6 +121,7 @@ QT_BEGIN_NAMESPACE /*! \fn QTextInlineObject::QTextInlineObject(int i, QTextEngine *e) + \internal Creates a new inline object for the item at position \a i in the text engine \a e. -- cgit v1.2.3 From cdba2439f91c1d3757e5d36f7759ac73a2e8ac2d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jul 2014 10:32:07 +0200 Subject: QSplitter: Exclude top level widgets from child event handling. Prevent the splitter from adding them to the layout or showing them. Task-number: QTBUG-40132 Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18 Reviewed-by: J-P Nurmi --- src/widgets/widgets/qsplitter.cpp | 6 +++-- .../widgets/widgets/qsplitter/tst_qsplitter.cpp | 29 +++++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index f58881af0d..1f29af319a 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtWidgets module of the Qt Toolkit. @@ -1224,7 +1224,9 @@ void QSplitter::childEvent(QChildEvent *c) return; } QWidget *w = static_cast(c->child()); - if (c->added() && !d->blockChildAdd && !w->isWindow() && !d->findWidget(w)) { + if (w->isWindow()) + return; + if (c->added() && !d->blockChildAdd && !d->findWidget(w)) { d->insertWidget_helper(d->list.count(), w, false); } else if (c->polished() && !d->blockChildAdd) { if (isVisible() && !(w->isHidden() && w->testAttribute(Qt::WA_WState_ExplicitShowHide))) diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp index 8de3291207..d66a10ae56 100644 --- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp +++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the test suite of the Qt Toolkit. @@ -54,6 +54,8 @@ #include #include #include +#include +#include #include // for file error messages QT_FORWARD_DECLARE_CLASS(QSplitter) @@ -94,6 +96,8 @@ private slots: void taskQTBUG_4101_ensureOneNonCollapsedWidget_data(); void taskQTBUG_4101_ensureOneNonCollapsedWidget(); void setLayout(); + void autoAdd(); + private: void removeThirdWidget(); void addThirdWidget(); @@ -781,5 +785,28 @@ void tst_QSplitter::setLayout() QCOMPARE(splitter.layout(), &layout); } +void tst_QSplitter::autoAdd() +{ + QSplitter splitter; + splitter.setWindowTitle("autoAdd"); + splitter.setMinimumSize(QSize(200, 200)); + splitter.move(QGuiApplication::primaryScreen()->availableGeometry().center() - QPoint(100, 100)); + splitter.show(); + QVERIFY(QTest::qWaitForWindowExposed(&splitter)); + // Constructing a child widget on the splitter should + // automatically add and show it. + QWidget *childWidget = new QWidget(&splitter); + QCOMPARE(splitter.count(), 1); + QTRY_VERIFY(childWidget->isVisible()); + // Deleting should automatically remove it + delete childWidget; + QCOMPARE(splitter.count(), 0); + // QTBUG-40132, top level windows should not be affected by this. + QDialog *dialog = new QDialog(&splitter); + QCOMPARE(splitter.count(), 0); + QCoreApplication::processEvents(); + QVERIFY(!dialog->isVisible()); +} + QTEST_MAIN(tst_QSplitter) #include "tst_qsplitter.moc" -- cgit v1.2.3 From 8ee19816c87918136ea84f8451ab9e9c9764c8de Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 3 Jul 2014 14:52:21 +0200 Subject: CMake: Don't check the existence of GL files in the Qt5Gui package. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GL libraries are optional, so they should not be added to the DEPENDENT libraries of Qt5::Gui if not found. Task-number: QTBUG-39859 Change-Id: Ib0e01da56a9fb5048a6ad8e0e9cede07fe0cf43b Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Stephen Kelly --- src/gui/Qt5GuiConfigExtras.cmake.in | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index d734e56d23..9a846d435e 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -66,7 +66,8 @@ if (NOT _qt5gui_OPENGL_INCLUDE_DIR) endif() unset(_GL_INCDIRS) -_qt5_Gui_check_file_exists(${_qt5gui_OPENGL_INCLUDE_DIR}) +# Don\'t check for existence of the "_qt5gui_OPENGL_INCLUDE_DIR" because it is +# optional. list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR}) set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR}) @@ -105,13 +106,18 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) ) !!IF mac set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}") + if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}") + set(Qt5Gui_${_cmake_lib_name}_LIBRARY) + endif() !!ENDIF - if (WIN32 AND NOT Qt5Gui_${_cmake_lib_name}_LIBRARY) + if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY) # The above find_library call doesn\'t work for finding # libraries in Windows SDK paths outside of the proper - # environment. Just add the library name to the result - # variable instead. - # We avoid doing this in the first case because Qt may be + # environment, even if the libraries are present. In other + # cases it is OK for the libraries to not be found + # because they are optional dependencies of Qt5Gui, needed + # only if the qopengl.h header is used. + # We try to find the libraries in the first place because Qt may be # compiled with another set of GL libraries (such as coming # from ANGLE). The point of these find calls is to try to # find the same binaries as Qt is compiled with (as they are @@ -119,7 +125,6 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) # above with paths known to qmake. set(_Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE TRUE) unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) - list(APPEND Qt5Gui_${Name}_LIBRARIES ${_lib}) else() add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_${Name}_INCLUDE_DIRS}) @@ -152,11 +157,6 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) endif() endif() endforeach() - if (NOT CMAKE_CROSSCOMPILING) - foreach(_dir ${Qt5Gui_${Name}_INCLUDE_DIRS}) - _qt5_Gui_check_file_exists(${_dir}) - endforeach() - endif() endmacro() -- cgit v1.2.3 From 6186dd857176fd119e0c6e0732238e0aa20c4ce4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 8 Jul 2014 13:35:06 +0200 Subject: make QtWidgets claim style plugins Change-Id: Ibb3fea65d59c2a43cd024fd34abfe558956bec69 Reviewed-by: J-P Nurmi --- src/widgets/widgets.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro index 0b289c75ae..b12e2836d4 100644 --- a/src/widgets/widgets.pro +++ b/src/widgets/widgets.pro @@ -9,6 +9,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused MODULE_PLUGIN_TYPES += \ + styles \ accessible/libqtaccessiblewidgets.so QMAKE_DOCS = $$PWD/doc/qtwidgets.qdocconf -- cgit v1.2.3 From feb1afc78290433b0c22b1b3f6d65542eeb5b957 Mon Sep 17 00:00:00 2001 From: Nikita Krupenko Date: Fri, 13 Jun 2014 20:04:16 +0300 Subject: Added stream version into network cache file format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the moment, there is no stream information in the cache file. This can lead to a problem when current stream version differs from version cache file written with. As an example, if file written with Qt 5.1.1, QTimeDate in the metadata stored as 13-bytes value, but Qt 5.2 and later can read additional 4 bytes which breaks following data, leading to network request just hangs forever. Adding stream version fixes this problem. As cache format changed, cache version bumped. Task-number: QTBUG-36219 Change-Id: I467d8c9fda82bcf9302192f51e7a00d2f6a9ff66 Reviewed-by: Jędrzej Nowacki --- src/network/access/qnetworkdiskcache.cpp | 10 ++- .../qnetworkdiskcache/tst_qnetworkdiskcache.cpp | 71 ++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index a1cbd9364e..86a3b20a9c 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -56,7 +56,7 @@ #define CACHE_POSTFIX QLatin1String(".d") #define PREPARED_SLASH QLatin1String("prepared/") -#define CACHE_VERSION 7 +#define CACHE_VERSION 8 #define DATA_DIR QLatin1String("data") #define MAX_COMPRESSION_SIZE (1024 * 1024 * 3) @@ -686,6 +686,7 @@ void QCacheItem::writeHeader(QFile *device) const out << qint32(CacheMagic); out << qint32(CurrentCacheVersion); + out << static_cast(out.version()); out << metaData; bool compressed = canCompress(); out << compressed; @@ -719,6 +720,13 @@ bool QCacheItem::read(QFile *device, bool readData) if (v != CurrentCacheVersion) return false; + qint32 streamVersion; + in >> streamVersion; + // Default stream version is also the highest we can handle + if (streamVersion > in.version()) + return false; + in.setVersion(streamVersion); + bool compressed; QByteArray dataBA; in >> metaData; diff --git a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp index 4740b92b84..d28f11ff9d 100644 --- a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp +++ b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp @@ -85,6 +85,9 @@ private slots: void oldCacheVersionFile_data(); void oldCacheVersionFile(); + void streamVersion_data(); + void streamVersion(); + void sync(); void crashWhenParentingCache(); @@ -568,6 +571,74 @@ void tst_QNetworkDiskCache::oldCacheVersionFile() } } +void tst_QNetworkDiskCache::streamVersion_data() +{ + QTest::addColumn("version"); + QTest::newRow("Qt 5.1") << int(QDataStream::Qt_5_1); + QDataStream ds; + QTest::newRow("current") << ds.version(); + QTest::newRow("higher than current") << ds.version() + 1; +} + +void tst_QNetworkDiskCache::streamVersion() +{ + SubQNetworkDiskCache cache; + QUrl url(EXAMPLE_URL); + cache.setupWithOne(tempDir.path(), url); + + QString cacheFile; + // find the file + QStringList files = countFiles(cache.cacheDirectory()); + foreach (const QString &file, files) { + QFileInfo info(file); + if (info.isFile()) { + cacheFile = file; + break; + } + } + + QFile file(cacheFile); + QVERIFY(file.open(QFile::ReadWrite|QIODevice::Truncate)); + QDataStream out(&file); + QFETCH(int, version); + if (version < out.version()) + out.setVersion(version); + out << qint32(0xe8); // cache magic + // Following code works only for cache file version 8 and should be updated on version change + out << qint32(8); + out << qint32(version); + + QNetworkCacheMetaData md; + md.setUrl(url); + QNetworkCacheMetaData::RawHeader header("content-type", "text/html"); + QNetworkCacheMetaData::RawHeaderList list; + list.append(header); + md.setRawHeaders(list); + md.setLastModified(QDateTime::currentDateTimeUtc().toOffsetFromUtc(3600)); + out << md; + + bool compressed = true; + out << compressed; + + QByteArray data("Hello World!"); + out << qCompress(data); + + file.close(); + + QNetworkCacheMetaData cachedMetaData = cache.call_fileMetaData(cacheFile); + if (version > out.version()) { + QVERIFY(!cachedMetaData.isValid()); + QVERIFY(!QFile::exists(cacheFile)); + } else { + QVERIFY(cachedMetaData.isValid()); + QVERIFY(QFile::exists(cacheFile)); + QIODevice *dataDevice = cache.data(url); + QVERIFY(dataDevice != 0); + QByteArray cachedData = dataDevice->readAll(); + QCOMPARE(cachedData, data); + } +} + class Runner : public QThread { -- cgit v1.2.3 From e2203163d9cd03165142d98fa9ba8aaf5a9c3085 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jul 2014 16:57:27 +0200 Subject: Windows: Send QTabletLeaveProximity events. Proximity leave comes without packets, do not bail out. Task-number: QTBUG-40019 Change-Id: I4e6b4ca13ad875bdfdcd31f86b08de4a596e76cb Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowstabletsupport.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 2a1e5c58b9..8ceab02311 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. @@ -347,7 +347,13 @@ QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(const quint64 uniqueI bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, LPARAM lParam) { - const bool enteredProximity = LOWORD(lParam) != 0; + if (!LOWORD(lParam)) { + qCDebug(lcQpaTablet) << "leave proximity for device #" << m_currentDevice; + QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice, + m_devices.at(m_currentDevice).currentPointerType, + m_devices.at(m_currentDevice).uniqueId); + return true; + } PACKET proximityBuffer[1]; // we are only interested in the first packet in this case const int totalPacks = QWindowsTabletSupport::m_winTab32DLL.wTPacketsGet(m_context, 1, proximityBuffer); if (!totalPacks) @@ -367,17 +373,11 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L m_devices.push_back(tabletInit(uniqueId, cursorType)); } m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor); - qCDebug(lcQpaTablet) << __FUNCTION__ << (enteredProximity ? "enter" : "leave") - << " proximity for device #" << m_currentDevice << m_devices.at(m_currentDevice); - if (enteredProximity) { - QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice, - m_devices.at(m_currentDevice).currentPointerType, - m_devices.at(m_currentDevice).uniqueId); - } else { - QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice, - m_devices.at(m_currentDevice).currentPointerType, - m_devices.at(m_currentDevice).uniqueId); - } + qCDebug(lcQpaTablet) << "enter proximity for device #" + << m_currentDevice << m_devices.at(m_currentDevice); + QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice, + m_devices.at(m_currentDevice).currentPointerType, + m_devices.at(m_currentDevice).uniqueId); return true; } -- cgit v1.2.3 From a71e285133087714034f3c84a758980c85b3801e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 14 Jul 2014 13:53:23 +0200 Subject: Ensure transient parents are top level widgets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a dialog was parented on a native child widget, its window handle was used as a transient parent. This confused QPlatformWindow::initialGeometry() among other things. Use top level window as is in Qt 4. Task-number: QTBUG-40195 Change-Id: Ic82adc276175f92adde825fb2551274351e41f30 Reviewed-by: Jørgen Lind --- src/gui/kernel/qwindow.cpp | 5 ++++ src/widgets/kernel/qwidget_qpa.cpp | 2 +- tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp | 32 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 40e9b9723a..d6f9fad070 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1083,6 +1083,11 @@ Qt::WindowState QWindow::windowState() const void QWindow::setTransientParent(QWindow *parent) { Q_D(QWindow); + if (parent && !parent->isTopLevel()) { + qWarning() << Q_FUNC_INFO << parent << "must be a top level window."; + return; + } + d->transientParent = parent; QGuiApplicationPrivate::updateBlockedStatus(this); diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 70d274796b..5a4bd33672 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -138,7 +138,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO if (QWidget *nativeParent = q->nativeParentWidget()) { if (nativeParent->windowHandle()) { if (flags & Qt::Window) { - win->setTransientParent(nativeParent->windowHandle()); + win->setTransientParent(nativeParent->window()->windowHandle()); win->setParent(0); } else { win->setTransientParent(0); diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp index c3d2c4a9e7..cd9ff28891 100644 --- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp +++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,8 @@ private slots: void setVisible(); void reject(); void snapToDefaultButton(); + void transientParent_data(); + void transientParent(); private: QDialog *testWidget; @@ -584,5 +587,34 @@ void tst_QDialog::snapToDefaultButton() #endif // !QT_NO_CURSOR } +void tst_QDialog::transientParent_data() +{ + QTest::addColumn("nativewidgets"); + QTest::newRow("Non-native") << false; + QTest::newRow("Native") << true; +} + +void tst_QDialog::transientParent() +{ + QFETCH(bool, nativewidgets); + testWidget->hide(); + QWidget topLevel; + topLevel.resize(200, 200); + topLevel.move(QGuiApplication::primaryScreen()->availableGeometry().center() - QPoint(100, 100)); + QVBoxLayout *layout = new QVBoxLayout(&topLevel); + QWidget *innerWidget = new QWidget(&topLevel); + layout->addWidget(innerWidget); + if (nativewidgets) + innerWidget->winId(); + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QDialog dialog(innerWidget); + dialog.show(); + QVERIFY(QTest::qWaitForWindowExposed(&dialog)); + // Transient parent should always be the top level, also when using + // native child widgets. + QCOMPARE(dialog.windowHandle()->transientParent(), topLevel.windowHandle()); +} + QTEST_MAIN(tst_QDialog) #include "tst_qdialog.moc" -- cgit v1.2.3 From 8b8eebd8a41bd91aeb5b55b702a4dbc7a8db5752 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 18 Jul 2014 14:35:36 +0200 Subject: generate QGL header file from qgl.h Task-number: QTBUG-16838 Change-Id: I511d0c18a13c5dc9b9ae7a28587440f48bc53427 Reviewed-by: Oswald Buddenhagen --- sync.profile | 1 + 1 file changed, 1 insertion(+) diff --git a/sync.profile b/sync.profile index 9823aa16bd..690de60ec7 100644 --- a/sync.profile +++ b/sync.profile @@ -33,6 +33,7 @@ "qnamespace.h" => "Qt", "qnumeric.h" => "QtNumeric", "qvariant.h" => "QVariantHash,QVariantList,QVariantMap", + "qgl.h" => "QGL", "qsql.h" => "QSql", "qssl.h" => "QSsl", "qtest.h" => "QTest", -- cgit v1.2.3 From e746e2a11a1fb0b4603df3d8740b09b362116698 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 10 Jul 2014 12:04:49 +0200 Subject: Android: Fix tests in gui/text requiring test data Several tests require test data to be deployed with the application. The easiest way to achieve this on Android is to add them to a qrc file and use the QFINDTESTDATA macro to look up the files. This fixes several test failures in the gui/text subdirectory for Android. Change-Id: If944bb1fc93434a1b2d6487da829d21bd6b84e87 Reviewed-by: BogDan Vatra --- tests/auto/gui/text/qcssparser/qcssparser.pro | 5 +++++ tests/auto/gui/text/qcssparser/testdata.qrc | 18 ++++++++++++++++++ tests/auto/gui/text/qcssparser/tst_qcssparser.cpp | 4 +++- tests/auto/gui/text/qglyphrun/qglyphrun.pro | 12 +++++++++--- tests/auto/gui/text/qglyphrun/testdata.qrc | 5 +++++ tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp | 2 +- tests/auto/gui/text/qrawfont/qrawfont.pro | 5 +++++ tests/auto/gui/text/qrawfont/testdata.qrc | 6 ++++++ tests/auto/gui/text/qzip/qzip.pro | 8 +++++--- tests/auto/gui/text/qzip/testdata.qrc | 6 ++++++ tests/auto/gui/text/qzip/tst_qzip.cpp | 4 ++-- 11 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 tests/auto/gui/text/qcssparser/testdata.qrc create mode 100644 tests/auto/gui/text/qglyphrun/testdata.qrc create mode 100644 tests/auto/gui/text/qrawfont/testdata.qrc create mode 100644 tests/auto/gui/text/qzip/testdata.qrc diff --git a/tests/auto/gui/text/qcssparser/qcssparser.pro b/tests/auto/gui/text/qcssparser/qcssparser.pro index 346a38d5f6..bb0c8c4f40 100644 --- a/tests/auto/gui/text/qcssparser/qcssparser.pro +++ b/tests/auto/gui/text/qcssparser/qcssparser.pro @@ -15,3 +15,8 @@ wince* { DEPLOYMENT += addFiles timesFont } +android { + RESOURCES += \ + testdata.qrc + +} diff --git a/tests/auto/gui/text/qcssparser/testdata.qrc b/tests/auto/gui/text/qcssparser/testdata.qrc new file mode 100644 index 0000000000..56e45cfbb0 --- /dev/null +++ b/tests/auto/gui/text/qcssparser/testdata.qrc @@ -0,0 +1,18 @@ + + + testdata/scanner/comments/input + testdata/scanner/comments/output + testdata/scanner/comments2/input + testdata/scanner/comments2/output + testdata/scanner/comments3/input + testdata/scanner/comments3/output + testdata/scanner/comments4/input + testdata/scanner/comments4/output + testdata/scanner/quotedstring/input + testdata/scanner/quotedstring/output + testdata/scanner/simple/input + testdata/scanner/simple/output + testdata/scanner/unicode/input + testdata/scanner/unicode/output + + diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index 86e282fad2..719ca5a0a7 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -130,7 +130,9 @@ void tst_QCssParser::scanner_data() QTest::addColumn("input"); QTest::addColumn("output"); -#if !defined(Q_OS_IRIX) && !defined(Q_OS_WINCE) +#if defined(Q_OS_ANDROID) + QDir d(":/"); +#elif !defined(Q_OS_IRIX) && !defined(Q_OS_WINCE) QDir d(SRCDIR); #else QDir d(QDir::current()); diff --git a/tests/auto/gui/text/qglyphrun/qglyphrun.pro b/tests/auto/gui/text/qglyphrun/qglyphrun.pro index db28a690a7..0993a5c49c 100644 --- a/tests/auto/gui/text/qglyphrun/qglyphrun.pro +++ b/tests/auto/gui/text/qglyphrun/qglyphrun.pro @@ -8,8 +8,14 @@ linux: CONFIG += insignificant_test SOURCES += \ tst_qglyphrun.cpp +android { + RESOURCES += \ + testdata.qrc +} + wince* { - DEFINES += SRCDIR=\\\"\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" + additionalFiles.files = test.ttf + additionalFiles.path = . + DEPLOYMENT += additionalFiles } + diff --git a/tests/auto/gui/text/qglyphrun/testdata.qrc b/tests/auto/gui/text/qglyphrun/testdata.qrc new file mode 100644 index 0000000000..c4e237ad2f --- /dev/null +++ b/tests/auto/gui/text/qglyphrun/testdata.qrc @@ -0,0 +1,5 @@ + + + test.ttf + + diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp index 3d2cde5fd3..f576627745 100644 --- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp +++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp @@ -94,7 +94,7 @@ void tst_QGlyphRun::initTestCase() { m_testFont_ok = false; - m_testFontId = QFontDatabase::addApplicationFont(SRCDIR "test.ttf"); + m_testFontId = QFontDatabase::addApplicationFont(QFINDTESTDATA("test.ttf")); QVERIFY(m_testFontId >= 0); m_testFont = QFont("QtsSpecialTestFont"); diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro index 540ffb94d7..1891e7a9bf 100644 --- a/tests/auto/gui/text/qrawfont/qrawfont.pro +++ b/tests/auto/gui/text/qrawfont/qrawfont.pro @@ -8,3 +8,8 @@ SOURCES += \ tst_qrawfont.cpp TESTDATA += testfont_bold_italic.ttf testfont.ttf + +android { + RESOURCES += \ + testdata.qrc +} diff --git a/tests/auto/gui/text/qrawfont/testdata.qrc b/tests/auto/gui/text/qrawfont/testdata.qrc new file mode 100644 index 0000000000..7bea0d5a39 --- /dev/null +++ b/tests/auto/gui/text/qrawfont/testdata.qrc @@ -0,0 +1,6 @@ + + + testfont_bold_italic.ttf + testfont.ttf + + diff --git a/tests/auto/gui/text/qzip/qzip.pro b/tests/auto/gui/text/qzip/qzip.pro index 309f2167d1..ebcd6ec022 100644 --- a/tests/auto/gui/text/qzip/qzip.pro +++ b/tests/auto/gui/text/qzip/qzip.pro @@ -7,7 +7,9 @@ wince* { addFiles.files = testdata addFiles.path = . DEPLOYMENT += addFiles - DEFINES += SRCDIR=\\\".\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" +} + +android { + RESOURCES += \ + testdata.qrc } diff --git a/tests/auto/gui/text/qzip/testdata.qrc b/tests/auto/gui/text/qzip/testdata.qrc new file mode 100644 index 0000000000..c7e3a6b14e --- /dev/null +++ b/tests/auto/gui/text/qzip/testdata.qrc @@ -0,0 +1,6 @@ + + + testdata/symlink.zip + testdata/test.zip + + diff --git a/tests/auto/gui/text/qzip/tst_qzip.cpp b/tests/auto/gui/text/qzip/tst_qzip.cpp index c5ce6c2676..9a5c4aaab9 100644 --- a/tests/auto/gui/text/qzip/tst_qzip.cpp +++ b/tests/auto/gui/text/qzip/tst_qzip.cpp @@ -68,7 +68,7 @@ void tst_QZip::cleanup() void tst_QZip::basicUnpack() { - QZipReader zip(QString(SRCDIR) + "/testdata/test.zip", QIODevice::ReadOnly); + QZipReader zip(QFINDTESTDATA("/testdata/test.zip"), QIODevice::ReadOnly); QList files = zip.fileInfoList(); QCOMPARE(files.count(), 2); @@ -104,7 +104,7 @@ void tst_QZip::basicUnpack() void tst_QZip::symlinks() { - QZipReader zip(QString(SRCDIR) + "/testdata/symlink.zip", QIODevice::ReadOnly); + QZipReader zip(QFINDTESTDATA("/testdata/symlink.zip"), QIODevice::ReadOnly); QList files = zip.fileInfoList(); QCOMPARE(files.count(), 2); -- cgit v1.2.3 From cf5e49681399c94b996a7b8b9299177361d926c1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 7 Jul 2014 16:22:14 +0200 Subject: Windows printing: Preserve painter when syncing state. Fix a performance regression introduced by 58bb42dc2c338338b7b6079993ace3d55c2e1d7e . The picture painter was replaced by another painter. Task-number: QTBUG-40068 Task-number: QTBUG-38329 Change-Id: Ida51edd61c197f862adebdcdc685ebc105fe07a8 Reviewed-by: Michael Bruning Reviewed-by: Lars Knoll --- src/printsupport/kernel/qpaintengine_alpha.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp index ddfa918b90..6d292a6a71 100644 --- a/src/printsupport/kernel/qpaintengine_alpha.cpp +++ b/src/printsupport/kernel/qpaintengine_alpha.cpp @@ -346,7 +346,10 @@ void QAlphaPaintEngine::flushAndInit(bool init) d->m_picpainter->setOpacity(painter()->opacity()); d->m_picpainter->setTransform(painter()->combinedTransform()); d->m_picengine->syncState(); - *d->m_picpainter->d_func()->state = *painter()->d_func()->state; + QPainterState &state = *d->m_picpainter->d_func()->state; + QPainter *oldPainter = state.painter; + state = *painter()->d_func()->state; + state.painter = oldPainter; } } -- cgit v1.2.3 From ae99f83312e2785cae280d4d7474050e163b7328 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 21 Jul 2014 13:55:30 +0200 Subject: Windows: Fix window geometry when transiting from fullscreen to maximized. The workaround added for QTBUG-8361 also needs to trigger in the restore-from-fullscreen logic, set flag accordingly. Task-number: QTBUG-40254 Task-number: QTBUG-8361 Change-Id: I6d6c35bb7004c84c6b8feea05ad974c23ca205d2 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index cdc0b24464..7d04c99d16 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1696,8 +1696,11 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) if (!wasSync) clearFlag(SynchronousGeometryChangeEvent); // preserve maximized state - if (visible) + if (visible) { + setFlag(WithinMaximize); ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE); + clearFlag(WithinMaximize); + } m_savedStyle = 0; m_savedFrameGeometry = QRect(); } -- cgit v1.2.3 From 6f3bb0aafab877c34dea3d9141a9931b5a7914a5 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 15 Jul 2014 15:25:23 +0200 Subject: tst_qurl: add tests for mailto parsing and toString. No bug. This was prompted by https://git.reviewboard.kde.org/r/119221 Change-Id: Ia148f07f6d711df533693918bbedfa5e7dc02cd5 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 92dbb96817..d5eab54363 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -1027,6 +1027,13 @@ void tst_QUrl::toString_data() QTest::newRow("underscore") << QString::fromLatin1("http://foo_bar.host.com/rss.php") << uint(QUrl::None) << QString::fromLatin1("http://foo_bar.host.com/rss.php"); + + QTest::newRow("mailto-brackets") << QString::fromLatin1("mailto:test[at]gmail[dot]com") + << uint(QUrl::PrettyDecoded) + << QString::fromLatin1("mailto:test[at]gmail[dot]com"); + QTest::newRow("mailto-query") << QString::fromLatin1("mailto:?to=test@example.com") + << uint(QUrl::PrettyDecoded) + << QString::fromLatin1("mailto:?to=test@example.com"); } void tst_QUrl::toString() -- cgit v1.2.3