From 626a4d89c2aec6354db9602ad1816e7f7e13d9b1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 7 Feb 2017 21:21:59 +0100 Subject: [PATCH 01/29] QFormLayout: take the correct row in takeRow() I didn't even try to understand what the old code was trying to do; once you're told by a user that the code is wrong, you see that it is. Fixed by just using the row as passed to takeRow() instead of trying to do some storage-index calculations. The m_matrix indexing operator does it all for us. Added a test that checks that the expected field widget gets returned. Fixed expected test data that was wrong, and just checking that the implementation behaves as implemented, instead of as documented. Amends change 8fbae648db3bc51bafacfe1f88e40561d357e60a. [ChangeLog][QtWidget][QFormLayout] The functions takeRow() and removeRow(), new in 5.8.0, now take and remove the correct row. Task-number: QTBUG-58693 Task-number: QTBUG-15990 Change-Id: I7185ccbc6c03e2579741cad5c0c821d3ed165474 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qformlayout.cpp | 13 ++++--------- .../kernel/qformlayout/tst_qformlayout.cpp | 15 +++++++++------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp index f3f72800306..6b134379c6f 100644 --- a/src/widgets/kernel/qformlayout.cpp +++ b/src/widgets/kernel/qformlayout.cpp @@ -1551,24 +1551,19 @@ QFormLayout::TakeRowResult QFormLayout::takeRow(int row) { Q_D(QFormLayout); - const int storageIndex = storageIndexFromLayoutItem(d->m_matrix, d->m_things.value(row)); - if (Q_UNLIKELY(storageIndex == -1)) { + if (Q_UNLIKELY(!(uint(row) < uint(d->m_matrix.rowCount())))) { qWarning("QFormLayout::takeRow: Invalid row %d", row); return TakeRowResult(); } - int storageRow, dummy; - QFormLayoutPrivate::ItemMatrix::storageIndexToPosition(storageIndex, &storageRow, &dummy); - Q_ASSERT(d->m_matrix(storageRow, dummy)); - - QFormLayoutItem *label = d->m_matrix(storageRow, 0); - QFormLayoutItem *field = d->m_matrix(storageRow, 1); + QFormLayoutItem *label = d->m_matrix(row, 0); + QFormLayoutItem *field = d->m_matrix(row, 1); Q_ASSERT(field); d->m_things.removeOne(label); d->m_things.removeOne(field); - d->m_matrix.removeRow(storageRow); + d->m_matrix.removeRow(row); invalidate(); diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp index d8239b5a289..c324a4bd565 100644 --- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp @@ -757,13 +757,14 @@ void tst_QFormLayout::removeRow() layout->removeRow(1); - QVERIFY(!w1); - QCOMPARE(layout->count(), 1); + QVERIFY(w1); + QVERIFY(!w2); + QCOMPARE(layout->count(), 2); QCOMPARE(layout->rowCount(), 1); layout->removeRow(0); - QVERIFY(!w2); + QVERIFY(!w1); QCOMPARE(layout->count(), 0); QCOMPARE(layout->rowCount(), 0); } @@ -863,17 +864,19 @@ void tst_QFormLayout::takeRow() QVERIFY(w2); QVERIFY(result.fieldItem); - QVERIFY(result.labelItem); - QCOMPARE(layout->count(), 1); + QVERIFY(!result.labelItem); + QCOMPARE(layout->count(), 2); QCOMPARE(layout->rowCount(), 1); + QCOMPARE(result.fieldItem->widget(), w2.data()); result = layout->takeRow(0); QVERIFY(w1); QVERIFY(result.fieldItem); - QVERIFY(!result.labelItem); + QVERIFY(result.labelItem); QCOMPARE(layout->count(), 0); QCOMPARE(layout->rowCount(), 0); + QCOMPARE(result.fieldItem->widget(), w1.data()); result = layout->takeRow(0); From 392b338f15a144b5ec611612b092366c0f42b9f2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 2 Feb 2017 18:00:53 +0100 Subject: [PATCH 02/29] move qfontengine_ft.* from gui to platformsupport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit that's where the files are actually used nowadays. also removes an obsolete (and bogus) gui export. Change-Id: I4551aad798acb6ce8c0abe43a2fcb8e5ac64a2d4 Reviewed-by: Konstantin Ritt Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- src/platformsupport/fontdatabases/basic/basic.pri | 4 ++-- .../fontdatabases/basic/qbasicfontdatabase.cpp | 3 +-- .../fontdatabases/basic}/qfontengine_ft.cpp | 0 .../fontdatabases/basic}/qfontengine_ft_p.h | 6 ------ .../fontdatabases/fontconfig/qfontconfigdatabase.cpp | 3 ++- .../fontdatabases/fontconfig/qfontenginemultifontconfig.cpp | 2 +- src/platformsupport/fontdatabases/mac/coretext.pri | 4 ++-- .../fontdatabases/mac/qcoretextfontdatabase.mm | 2 +- .../fontdatabases/windows/qwindowsfontdatabase_ft.cpp | 3 ++- .../fontdatabases/winrt/qwinrtfontdatabase.cpp | 3 ++- 10 files changed, 13 insertions(+), 17 deletions(-) rename src/{gui/text => platformsupport/fontdatabases/basic}/qfontengine_ft.cpp (100%) rename src/{gui/text => platformsupport/fontdatabases/basic}/qfontengine_ft_p.h (98%) diff --git a/src/platformsupport/fontdatabases/basic/basic.pri b/src/platformsupport/fontdatabases/basic/basic.pri index c50dba3ce27..d16aabb4c77 100644 --- a/src/platformsupport/fontdatabases/basic/basic.pri +++ b/src/platformsupport/fontdatabases/basic/basic.pri @@ -1,9 +1,9 @@ HEADERS += \ $$PWD/qbasicfontdatabase_p.h \ - $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft_p.h + $$PWD/qfontengine_ft_p.h SOURCES += \ $$PWD/qbasicfontdatabase.cpp \ - $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft.cpp + $$PWD/qfontengine_ft.cpp QMAKE_USE += freetype diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp index 60ddc9fa233..0826b0f2fb4 100644 --- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp @@ -49,8 +49,7 @@ #include #undef QT_NO_FREETYPE -#include -#include +#include #include #include FT_TRUETYPE_TABLES_H diff --git a/src/gui/text/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/basic/qfontengine_ft.cpp similarity index 100% rename from src/gui/text/qfontengine_ft.cpp rename to src/platformsupport/fontdatabases/basic/qfontengine_ft.cpp diff --git a/src/gui/text/qfontengine_ft_p.h b/src/platformsupport/fontdatabases/basic/qfontengine_ft_p.h similarity index 98% rename from src/gui/text/qfontengine_ft_p.h rename to src/platformsupport/fontdatabases/basic/qfontengine_ft_p.h index 32357d0076a..c5f3b0443e2 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/platformsupport/fontdatabases/basic/qfontengine_ft_p.h @@ -126,13 +126,7 @@ private: QFontEngine::Holder hbFace; }; -// If this is exported this breaks compilation of the windows -// plugin as qfontengine_ft_p.h/.cpp are also compiled there -#ifndef Q_OS_WIN -class Q_GUI_EXPORT QFontEngineFT : public QFontEngine -#else class QFontEngineFT : public QFontEngine -#endif { public: diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 65bc494e917..2c5ce3e87d0 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -40,6 +40,8 @@ #include "qfontconfigdatabase_p.h" #include "qfontenginemultifontconfig_p.h" +#include + #include #include #include @@ -49,7 +51,6 @@ #include #include -#include #include #include diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp index 7574f9f9e6e..2fbcb6216ef 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp @@ -39,7 +39,7 @@ #include "qfontenginemultifontconfig_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/fontdatabases/mac/coretext.pri b/src/platformsupport/fontdatabases/mac/coretext.pri index 1caeb2c1acc..f4e9404371b 100644 --- a/src/platformsupport/fontdatabases/mac/coretext.pri +++ b/src/platformsupport/fontdatabases/mac/coretext.pri @@ -3,8 +3,8 @@ OBJECTIVE_SOURCES += $$PWD/qfontengine_coretext.mm $$PWD/qcoretextfontdatabase.m qtConfig(freetype) { QMAKE_USE += freetype - HEADERS += $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft_p.h - SOURCES += $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft.cpp + HEADERS += basic/qfontengine_ft_p.h + SOURCES += basic/qfontengine_ft.cpp } uikit: \ diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 1e29b12ec47..3d94982f60d 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -53,7 +53,7 @@ #include #include #ifndef QT_NO_FREETYPE -#include +#include #endif QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp index 7cfebf0436d..65947ab7da3 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp @@ -40,6 +40,8 @@ #include "qwindowsfontdatabase_ft_p.h" #include "qwindowsfontdatabase_p.h" +#include + #include #include FT_TRUETYPE_TABLES_H @@ -47,7 +49,6 @@ #include #include #include -#include #include #include diff --git a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp index 9f4b182ecee..eb5a38855e2 100644 --- a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp @@ -39,11 +39,12 @@ #include "qwinrtfontdatabase_p.h" +#include + #include #include #include -#include #include #include using namespace Microsoft::WRL; From 5152c3ca82a0f47273e3bfc59a5a29e0503ed7dd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 16:29:51 +0100 Subject: [PATCH 03/29] make freetype & fontconfig dependencies private again exporting the freetype dependency caused qtwayland to break with -qt-freetype, as the helper libraries' module pri files are not installed (for good reasons) after f9a80e06a, no actual user of FontDatabaseSupport needs access to the transitive dependencies anyway (one of the headers has a fontconfig dependency, but it's not used outside the module itself), so hiding them again is just fine. this partially reverts ec774500f. Task-number: QTBUG-56666 Change-Id: I9e68a7e0725a92833b856c9ffdbec61c8aa5fed2 Reviewed-by: Joerg Bornemann --- src/platformsupport/fontdatabases/basic/basic.pri | 2 +- src/platformsupport/fontdatabases/fontconfig/fontconfig.pri | 2 +- src/platformsupport/fontdatabases/mac/coretext.pri | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/fontdatabases/basic/basic.pri b/src/platformsupport/fontdatabases/basic/basic.pri index d16aabb4c77..0617bf74d79 100644 --- a/src/platformsupport/fontdatabases/basic/basic.pri +++ b/src/platformsupport/fontdatabases/basic/basic.pri @@ -6,4 +6,4 @@ SOURCES += \ $$PWD/qbasicfontdatabase.cpp \ $$PWD/qfontengine_ft.cpp -QMAKE_USE += freetype +QMAKE_USE_PRIVATE += freetype diff --git a/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri b/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri index 6458464870d..671d6be237c 100644 --- a/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri +++ b/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri @@ -3,4 +3,4 @@ HEADERS += $$PWD/qfontconfigdatabase_p.h \ SOURCES += $$PWD/qfontconfigdatabase.cpp \ $$PWD/qfontenginemultifontconfig.cpp -QMAKE_USE += fontconfig +QMAKE_USE_PRIVATE += fontconfig diff --git a/src/platformsupport/fontdatabases/mac/coretext.pri b/src/platformsupport/fontdatabases/mac/coretext.pri index f4e9404371b..50dafc3f89d 100644 --- a/src/platformsupport/fontdatabases/mac/coretext.pri +++ b/src/platformsupport/fontdatabases/mac/coretext.pri @@ -2,7 +2,7 @@ HEADERS += $$PWD/qcoretextfontdatabase_p.h $$PWD/qfontengine_coretext_p.h OBJECTIVE_SOURCES += $$PWD/qfontengine_coretext.mm $$PWD/qcoretextfontdatabase.mm qtConfig(freetype) { - QMAKE_USE += freetype + QMAKE_USE_PRIVATE += freetype HEADERS += basic/qfontengine_ft_p.h SOURCES += basic/qfontengine_ft.cpp } From 9e579f64d7cb1bb6c185ff5555b3e4b4b2076dea Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 2 Feb 2017 20:10:23 +0100 Subject: [PATCH 04/29] don't litter configure test build dirs with .qmake.cache files there should be only one, at the level of the isolating .qmake.conf. Change-Id: I25f05864d6f5c1bb5caf2fb4138adb4bb9cc2f22 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 81c63205a76..2732d2ad0f4 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -718,7 +718,8 @@ defineTest(qtConfTest_compile) { isEmpty(host): host = false test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test - test_out_dir = $$shadowed($$test_dir) + test_base_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR) + test_out_dir = $$test_base_out_dir/$$test !isEmpty($${1}.pro): \ test_dir = $$test_dir/$$eval($${1}.pro) test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" @@ -775,7 +776,7 @@ defineTest(qtConfTest_compile) { QMAKE_MAKE = "$$QMAKE_MAKE clean && $$QMAKE_MAKE" mkpath($$test_out_dir)|error() - write_file($$test_out_dir/.qmake.cache)|error() + write_file($$test_base_out_dir/.qmake.cache)|error() # add possible command line args qmake_args += $$qtConfPrepareArgs($$eval($${1}.args)) $$eval($${1}.literal_args) From ba43ecade3d86673c4b71f3a048b88330285cfe0 Mon Sep 17 00:00:00 2001 From: Julien Gueytat Date: Fri, 3 Feb 2017 01:36:36 +0100 Subject: [PATCH 05/29] Move configuration into includes Use of gcc-base.conf, g++-base.conf files and creation of solaris.conf. The content of solaris.conf should follow the content of linux.conf. Task-number: QTBUG-56293 Change-Id: I59cf9efa82ab0a2b22ea1a58f6339280460e5f92 Reviewed-by: Oswald Buddenhagen --- mkspecs/common/solaris.conf | 27 ++++++++++++++ mkspecs/solaris-g++-64/qmake.conf | 62 +++++-------------------------- mkspecs/solaris-g++/qmake.conf | 61 ++++-------------------------- 3 files changed, 45 insertions(+), 105 deletions(-) create mode 100644 mkspecs/common/solaris.conf diff --git a/mkspecs/common/solaris.conf b/mkspecs/common/solaris.conf new file mode 100644 index 00000000000..d965cb44d03 --- /dev/null +++ b/mkspecs/common/solaris.conf @@ -0,0 +1,27 @@ +# +# qmake configuration for common solaris +# + +QMAKE_PLATFORM += solaris + +include(unix.conf) + +QMAKE_CFLAGS_THREAD = -D_REENTRANT +QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD + +QMAKE_INCDIR = /usr/sfw/include +QMAKE_INCDIR_X11 = /usr/openwin/include +QMAKE_INCDIR_OPENGL = /usr/openwin/include + +QMAKE_LIBS = +QMAKE_LIBS_DYNLOAD = -ldl +QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl +QMAKE_LIBS_NIS = +QMAKE_LIBS_OPENGL = -lGL +QMAKE_LIBS_THREAD = -lpthread -lrt +QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl + +QMAKE_AR = ar cq +QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P +QMAKE_RANLIB = diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf index 91ffb9193ee..e42dc970dec 100644 --- a/mkspecs/solaris-g++-64/qmake.conf +++ b/mkspecs/solaris-g++-64/qmake.conf @@ -1,5 +1,5 @@ # -# qmake configuration for solaris-g++64 +# qmake configuration for solaris-g++-64 # # The X11 header files used to be broken on Solaris until patches were # released in early 2001 for Solaris 2.6, 7, and 8. On Solaris 2.5.1 @@ -26,54 +26,20 @@ # MAKEFILE_GENERATOR = UNIX -QMAKE_PLATFORM = solaris +CONFIG += incremental +QMAKE_INCREMENTAL_STYLE = sublib -include(../common/unix.conf) +include(../common/solaris.conf) -QMAKE_COMPILER = gcc - -QMAKE_CC = gcc -QMAKE_LEX = flex -QMAKE_LEXFLAGS = -QMAKE_YACC = yacc -QMAKE_YACCFLAGS = -d QMAKE_CFLAGS = -m64 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -QMAKE_CFLAGS_DEPS = -M -QMAKE_CFLAGS_WARN_ON = -Wall -W -QMAKE_CFLAGS_WARN_OFF = -w -QMAKE_CFLAGS_RELEASE = -O2 -QMAKE_CFLAGS_DEBUG = -g -QMAKE_CFLAGS_SHLIB = -fPIC -QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses -QMAKE_CFLAGS_THREAD = -D_REENTRANT +QMAKE_LFLAGS = -m64 -QMAKE_CXX = g++ -QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS -QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF -QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE -QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG -QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB -QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC -QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD - -QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib/64 -QMAKE_INCDIR_X11 = /usr/openwin/include QMAKE_LIBDIR_X11 = /usr/openwin/lib/64 -QMAKE_INCDIR_OPENGL = /usr/openwin/include QMAKE_LIBDIR_OPENGL = /usr/openwin/lib/64 -QMAKE_LINK = g++ -QMAKE_LINK_SHLIB = g++ -QMAKE_LINK_C = gcc -QMAKE_LINK_C_SHLIB = gcc -QMAKE_LFLAGS = -m64 -QMAKE_LFLAGS_RELEASE = -QMAKE_LFLAGS_DEBUG = -g +include(../common/gcc-base.conf) + QMAKE_LFLAGS_SHLIB = -shared QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_SONAME = -h$$LITERAL_WHITESPACE @@ -81,17 +47,9 @@ QMAKE_LFLAGS_THREAD = QMAKE_LFLAGS_NOUNDEF = -z defs QMAKE_LFLAGS_RPATH = -Wl,-R, -QMAKE_LIBS = -QMAKE_LIBS_DYNLOAD = -ldl -QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl -QMAKE_LIBS_NIS = -QMAKE_LIBS_OPENGL = -lGL -QMAKE_LIBS_THREAD = -lpthread -lrt -QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl +include(../common/g++-base.conf) -QMAKE_AR = ar cq -QMAKE_OBJCOPY = objcopy -QMAKE_NM = nm -P -QMAKE_RANLIB = +QMAKE_LFLAGS_RELEASE = +QMAKE_LFLAGS_DEBUG = -g load(qt_config) diff --git a/mkspecs/solaris-g++/qmake.conf b/mkspecs/solaris-g++/qmake.conf index 594646353d7..6f7d9e4c05c 100644 --- a/mkspecs/solaris-g++/qmake.conf +++ b/mkspecs/solaris-g++/qmake.conf @@ -9,54 +9,17 @@ # MAKEFILE_GENERATOR = UNIX -QMAKE_PLATFORM = solaris +CONFIG += incremental +QMAKE_INCREMENTAL_STYLE = sublib -include(../common/unix.conf) +include(../common/solaris.conf) -QMAKE_COMPILER = gcc - -QMAKE_CC = gcc -QMAKE_LEX = flex -QMAKE_LEXFLAGS = -QMAKE_YACC = yacc -QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -QMAKE_CFLAGS_DEPS = -M -QMAKE_CFLAGS_WARN_ON = -Wall -W -QMAKE_CFLAGS_WARN_OFF = -w -QMAKE_CFLAGS_RELEASE = -O2 -QMAKE_CFLAGS_DEBUG = -g -QMAKE_CFLAGS_SHLIB = -fPIC -QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses -QMAKE_CFLAGS_THREAD = -D_REENTRANT - -QMAKE_CXX = g++ -QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS -QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF -QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE -QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG -QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB -QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC -QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD - -QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib -QMAKE_INCDIR_X11 = /usr/openwin/include QMAKE_LIBDIR_X11 = /usr/openwin/lib -QMAKE_INCDIR_OPENGL = /usr/openwin/include QMAKE_LIBDIR_OPENGL = /usr/openwin/lib -QMAKE_LINK = g++ -QMAKE_LINK_SHLIB = g++ -QMAKE_LINK_C = gcc -QMAKE_LINK_C_SHLIB = gcc -QMAKE_LFLAGS = -QMAKE_LFLAGS_RELEASE = -QMAKE_LFLAGS_DEBUG = -g +include(../common/gcc-base.conf) + QMAKE_LFLAGS_SHLIB = -shared QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_SONAME = -h$$LITERAL_WHITESPACE @@ -64,17 +27,9 @@ QMAKE_LFLAGS_THREAD = QMAKE_LFLAGS_NOUNDEF = -z defs QMAKE_LFLAGS_RPATH = -Wl,-R, -QMAKE_LIBS = -QMAKE_LIBS_DYNLOAD = -ldl -QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl -QMAKE_LIBS_NIS = -QMAKE_LIBS_OPENGL = -lGL -QMAKE_LIBS_THREAD = -lpthread -lrt -QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl +include(../common/g++-base.conf) -QMAKE_AR = ar cq -QMAKE_OBJCOPY = objcopy -QMAKE_NM = nm -P -QMAKE_RANLIB = +QMAKE_LFLAGS_RELEASE = +QMAKE_LFLAGS_DEBUG = -g load(qt_config) From 9d6d9984f56366f40b4e0c5391a2acb988d2b2c7 Mon Sep 17 00:00:00 2001 From: Julien Gueytat Date: Fri, 3 Feb 2017 01:44:20 +0100 Subject: [PATCH 06/29] Update Solaris include path and library path The path match OpenIndiana distribution based on Illumos. Task-number: QTBUG-56293 Change-Id: I44e7defa63809dc4f413b46329481b53e5e74c30 Reviewed-by: Oswald Buddenhagen --- mkspecs/common/solaris.conf | 5 ++--- mkspecs/solaris-g++-64/qmake.conf | 5 ++--- mkspecs/solaris-g++/qmake.conf | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/mkspecs/common/solaris.conf b/mkspecs/common/solaris.conf index d965cb44d03..8581838434b 100644 --- a/mkspecs/common/solaris.conf +++ b/mkspecs/common/solaris.conf @@ -9,9 +9,8 @@ include(unix.conf) QMAKE_CFLAGS_THREAD = -D_REENTRANT QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD -QMAKE_INCDIR = /usr/sfw/include -QMAKE_INCDIR_X11 = /usr/openwin/include -QMAKE_INCDIR_OPENGL = /usr/openwin/include +QMAKE_INCDIR_X11 = /usr/X11/include +QMAKE_INCDIR_OPENGL = /usr/X11/include/mesa QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf index e42dc970dec..6fc93d45b75 100644 --- a/mkspecs/solaris-g++-64/qmake.conf +++ b/mkspecs/solaris-g++-64/qmake.conf @@ -34,9 +34,8 @@ include(../common/solaris.conf) QMAKE_CFLAGS = -m64 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ QMAKE_LFLAGS = -m64 -QMAKE_LIBDIR = /usr/sfw/lib/64 -QMAKE_LIBDIR_X11 = /usr/openwin/lib/64 -QMAKE_LIBDIR_OPENGL = /usr/openwin/lib/64 +QMAKE_LIBDIR_X11 = /usr/X11/lib/64 +QMAKE_LIBDIR_OPENGL = /usr/X11/lib/64 include(../common/gcc-base.conf) diff --git a/mkspecs/solaris-g++/qmake.conf b/mkspecs/solaris-g++/qmake.conf index 6f7d9e4c05c..943b0865c95 100644 --- a/mkspecs/solaris-g++/qmake.conf +++ b/mkspecs/solaris-g++/qmake.conf @@ -14,9 +14,8 @@ QMAKE_INCREMENTAL_STYLE = sublib include(../common/solaris.conf) -QMAKE_LIBDIR = /usr/sfw/lib -QMAKE_LIBDIR_X11 = /usr/openwin/lib -QMAKE_LIBDIR_OPENGL = /usr/openwin/lib +QMAKE_LIBDIR_X11 = /usr/X11/lib +QMAKE_LIBDIR_OPENGL = /usr/X11/lib include(../common/gcc-base.conf) From 91f8a41404acd33c54021247eb550c6f796f1f61 Mon Sep 17 00:00:00 2001 From: Julien Gueytat Date: Mon, 6 Feb 2017 23:00:53 +0100 Subject: [PATCH 07/29] Complete solaris.conf following linux.conf template Task-number: QTBUG-56293 Change-Id: I9e0240b3d4766f5c740a044d6eff44d21b340dc0 Reviewed-by: Oswald Buddenhagen --- mkspecs/common/solaris.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mkspecs/common/solaris.conf b/mkspecs/common/solaris.conf index 8581838434b..b53227204d7 100644 --- a/mkspecs/common/solaris.conf +++ b/mkspecs/common/solaris.conf @@ -8,6 +8,10 @@ include(unix.conf) QMAKE_CFLAGS_THREAD = -D_REENTRANT QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD +QMAKE_LFLAGS_GCSECTIONS = -Wl,-z,ignore + +QMAKE_LFLAGS_REL_RPATH = -Wl,-z,origin +QMAKE_REL_RPATH_BASE = $ORIGIN QMAKE_INCDIR_X11 = /usr/X11/include QMAKE_INCDIR_OPENGL = /usr/X11/include/mesa @@ -24,3 +28,6 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_NM = nm -P QMAKE_RANLIB = + +QMAKE_STRIP = gstrip +QMAKE_STRIPFLAGS_LIB += --strip-unneeded From 5f8fc8395f73f6a342ba9e41d97322241b280f62 Mon Sep 17 00:00:00 2001 From: Julien Gueytat Date: Sun, 5 Feb 2017 21:59:36 +0100 Subject: [PATCH 08/29] Remove _XOPEN_SOURCE=500 -D__EXTENSIONS__ The value _XOPEN_SOURCE=600 should be used for C99 as we compile at least with C++11. By doing so the compilation reaches another error in a third library. Simply removing the option makes the compilation working normally. Task-number: QTBUG-56293 Change-Id: Ie040325936591958d05cc0a2d43643fa5d0c43b5 Reviewed-by: Oswald Buddenhagen --- mkspecs/solaris-g++-64/qmake.conf | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf index 6fc93d45b75..82cd77b8889 100644 --- a/mkspecs/solaris-g++-64/qmake.conf +++ b/mkspecs/solaris-g++-64/qmake.conf @@ -7,23 +7,6 @@ # between GCC 2.95 or better and Solaris - but we still get warnings # because we don't use -isystem. # -# From the standards(5) manual page: -# The XNS4 specification is safe for use only in ILP32 (32-bit) -# environments and should not be used for LP64 (64-bit) -# application environments. Use XNS5, which has LP64-clean -# interfaces that are portable across ILP32 and LP64 environments. -# [...] -# For platforms supporting the LP64 (64-bit) programming environment -# where the SC5.0 Compilers have been installed, SUSv2-conforming LP64 -# applications using XNS5 library calls should be built with command -# lines of the form: -# c89 $(getconf XBS5_LP64_OFF64_CFLAGS) -D_XOPEN_SOURCE=500 \ -# $(getconf XBS5_LP64_OFF64_LDFLAGS) foo.c -o foo \ -# $(getconf XBS5_LP64_OFF64_LIBS) -lxnet -# So it appears that _XOPEN_SOURCE=500 should be defined when building -# 64-bit applications (on Solaris 7 and better). But then __EXTENSIONS__ -# should be defined as well to recover all the default system interface. -# MAKEFILE_GENERATOR = UNIX CONFIG += incremental @@ -31,7 +14,7 @@ QMAKE_INCREMENTAL_STYLE = sublib include(../common/solaris.conf) -QMAKE_CFLAGS = -m64 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ +QMAKE_CFLAGS = -m64 QMAKE_LFLAGS = -m64 QMAKE_LIBDIR_X11 = /usr/X11/lib/64 From 6c8aabbe5232314916084e4a1eaec6e9f03494a2 Mon Sep 17 00:00:00 2001 From: Julien Gueytat Date: Sun, 5 Feb 2017 22:03:37 +0100 Subject: [PATCH 09/29] Remove out of date comments related to Xorg and GCC Task-number: QTBUG-56293 Change-Id: I8d2245755d08b528e2041a16aabb390f3796e545 Reviewed-by: Oswald Buddenhagen --- mkspecs/solaris-g++-64/qmake.conf | 6 ------ mkspecs/solaris-g++/qmake.conf | 6 ------ 2 files changed, 12 deletions(-) diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf index 82cd77b8889..f509555ad98 100644 --- a/mkspecs/solaris-g++-64/qmake.conf +++ b/mkspecs/solaris-g++-64/qmake.conf @@ -1,12 +1,6 @@ # # qmake configuration for solaris-g++-64 # -# The X11 header files used to be broken on Solaris until patches were -# released in early 2001 for Solaris 2.6, 7, and 8. On Solaris 2.5.1 -# or non-patched systems -fpermissive works around the incompatibility -# between GCC 2.95 or better and Solaris - but we still get warnings -# because we don't use -isystem. -# MAKEFILE_GENERATOR = UNIX CONFIG += incremental diff --git a/mkspecs/solaris-g++/qmake.conf b/mkspecs/solaris-g++/qmake.conf index 943b0865c95..7c6c9d04a41 100644 --- a/mkspecs/solaris-g++/qmake.conf +++ b/mkspecs/solaris-g++/qmake.conf @@ -1,12 +1,6 @@ # # qmake configuration for solaris-g++ # -# The X11 header files used to be broken on Solaris until patches were -# released in early 2001 for Solaris 2.6, 7, and 8. On Solaris 2.5.1 -# or non-patched systems -fpermissive works around the incompatibility -# between GCC 2.95 or better and Solaris - but we still get warnings -# because we don't use -isystem. -# MAKEFILE_GENERATOR = UNIX CONFIG += incremental From 4f3ea309222bf9af61f721b39265b651ab297914 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 6 Feb 2017 19:41:46 -0800 Subject: [PATCH 10/29] Avoid unnecessary creation of some Q_GLOBAL_STATIC If these lists weren't created in the first place, then they are empty. We don't need to create it in order to conclude that. Unlike most Q_GLOBAL_STATICS, these are almost never used and yet they were always created due to where they were checked. Since we're calling exists() before, there are two consequences: first, since the list already exists, we're not allocating memory so it cannot throw std::bad_alloc when being accessed. Second, since we've just checked it exists, we can use QGlobalStatic's operator*(), which is slightly faster than operator()(). The weird &(*list) syntax is only to avoid changing the rest of the code that used a pointer Change-Id: Ifaee7464122d402991b6fffd14a0e44f533dc3d9 Reviewed-by: Marc Mutz --- src/corelib/global/qglobal.cpp | 5 ++++- src/corelib/kernel/qcoreapplication.cpp | 17 ++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index bc6560ddae5..54df8b1f61e 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -4027,7 +4027,10 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) { Q_ASSERT_X(cb >= 0, "QInternal::activateCallback()", "Callback id must be a valid id"); - QInternal_CallBackTable *cbt = global_callback_table(); + if (!global_callback_table.exists()) + return false; + + QInternal_CallBackTable *cbt = &(*global_callback_table); if (cbt && cb < cbt->callbacks.size()) { QList callbacks = cbt->callbacks[cb]; bool ret = false; diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 96167b4508a..c5f2e71f8c7 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -270,12 +270,13 @@ void qRemovePostRoutine(QtCleanUpFunction p) static void qt_call_pre_routines() { - QStartUpFuncList *list = preRList(); - if (!list) + if (!preRList.exists()) return; + #ifndef QT_NO_THREAD QMutexLocker locker(&globalPreRoutinesMutex); #endif + QVFuncList *list = &(*preRList); // Unlike qt_call_post_routines, we don't empty the list, because // Q_COREAPP_STARTUP_FUNCTION is a macro, so the user expects // the function to be executed every time QCoreApplication is created. @@ -285,16 +286,10 @@ static void qt_call_pre_routines() void Q_CORE_EXPORT qt_call_post_routines() { - QVFuncList *list = 0; - QT_TRY { - list = postRList(); - } QT_CATCH(const std::bad_alloc &) { - // ignore - if we can't allocate a post routine list, - // there's a high probability that there's no post - // routine to be executed :) - } - if (!list) + if (!postRList.exists()) return; + + QVFuncList *list = &(*postRList); while (!list->isEmpty()) (list->takeFirst())(); } From 136c5b9338f71775eb42528cfc7c23b2b4e5dff9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 6 Feb 2017 20:05:02 -0800 Subject: [PATCH 11/29] Merge several Q_GLOBAL_STATICs in qresource.cpp into one Since they are all used in a typical application, this reduces the number of memory allocations (thus, the overhead) as well as the state-keeping in the libc atexit() functions. Change-Id: Ifaee7464122d402991b6fffd14a0e59457ad9cb7 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/io/qresource.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index febf22639c4..32639759e43 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -149,12 +149,23 @@ static QString cleanPath(const QString &_path) Q_DECLARE_TYPEINFO(QResourceRoot, Q_MOVABLE_TYPE); -Q_GLOBAL_STATIC_WITH_ARGS(QMutex, resourceMutex, (QMutex::Recursive)) - typedef QList ResourceList; -Q_GLOBAL_STATIC(ResourceList, resourceList) +struct QResourceGlobalData +{ + QMutex resourceMutex{QMutex::Recursive}; + ResourceList resourceList; + QStringList resourceSearchPaths; +}; +Q_GLOBAL_STATIC(QResourceGlobalData, resourceGlobalData) -Q_GLOBAL_STATIC(QStringList, resourceSearchPaths) +static inline QMutex *resourceMutex() +{ return &resourceGlobalData->resourceMutex; } + +static inline ResourceList *resourceList() +{ return &resourceGlobalData->resourceList; } + +static inline QStringList *resourceSearchPaths() +{ return &resourceGlobalData->resourceSearchPaths; } /*! \class QResource @@ -870,6 +881,9 @@ Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree, Q_CORE_EXPORT bool qUnregisterResourceData(int version, const unsigned char *tree, const unsigned char *name, const unsigned char *data) { + if (resourceGlobalData.isDestroyed()) + return false; + QMutexLocker lock(resourceMutex()); if ((version == 0x01 || version == 0x02) && resourceList()) { QResourceRoot res(version, tree, name, data); From 0f2638c994f665bfca2d40cd5b40cc25dac8023e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 8 Feb 2017 12:04:54 +0100 Subject: [PATCH 12/29] Blacklist tst_QElapsedTimer::elapsed() on Windows This test was determined to be flaky on the CI. Task-number: QTBUG-58713 Change-Id: Ie6e6a69b8ea625e3a3102c88d52f1f0fbec242aa Reviewed-by: Lars Knoll --- tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST diff --git a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST new file mode 100644 index 00000000000..f6a49f032ca --- /dev/null +++ b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST @@ -0,0 +1,2 @@ +[elapsed] +windows From 559bfa09e4000d32bbfeba2d6f27e5f722450734 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 9 Feb 2017 15:20:04 +0100 Subject: [PATCH 13/29] refuse to build EGLFS on android, darwin, and windows ... instead of merely defaulting it to off on android and windows. this reflects actual reality. Change-Id: I880254138bedd07124aa00096a06dd6e1803feb9 Reviewed-by: Laszlo Agocs --- src/gui/configure.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/configure.json b/src/gui/configure.json index 35741abc868..2dc70c5ea24 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -600,8 +600,7 @@ "eglfs": { "label": "EGLFS", "section": "Platform plugins", - "autoDetect": "!config.android && !config.win32", - "condition": "features.egl", + "condition": "!config.android && !config.darwin && !config.win32 && features.egl", "output": [ "privateFeature" ] }, "eglfs_brcm": { From 2a48f7b189ab578b13bd2b9b459c2d096ba519dd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 9 Feb 2017 15:18:38 +0100 Subject: [PATCH 14/29] make libinput axis api feature depend on libinput amends b4085e56. Change-Id: Id18a7de6496e8e9164cb247426aba1293aa4ea2e Reviewed-by: Laszlo Agocs --- src/gui/configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/configure.json b/src/gui/configure.json index 2dc70c5ea24..9b93bcf3e2a 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -511,7 +511,7 @@ }, "libinput-axis-api": { "label": "axis API in libinput", - "condition": "tests.libinput_axis_api", + "condition": "features.libinput && tests.libinput_axis_api", "output": [ "privateFeature" ] }, "lgmon": { From b052d0cffd30ba488bf73c8ee57085e5c023298f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 8 Feb 2017 13:19:44 +0100 Subject: [PATCH 15/29] rename qvector.cpp => qvector.qdoc the file contains no code. this avoids complaints from ar/ranlib in static/bootstrapped builds. Change-Id: Iee22ffc61a5f9ea8c25f5455b7e8e017ac521624 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- qmake/Makefile.unix | 7 ++----- qmake/Makefile.win32 | 1 - qmake/qmake.pri | 1 - src/corelib/tools/{qvector.cpp => qvector.qdoc} | 0 src/corelib/tools/tools.pri | 1 - src/tools/bootstrap/bootstrap.pro | 1 - 6 files changed, 2 insertions(+), 9 deletions(-) rename src/corelib/tools/{qvector.cpp => qvector.qdoc} (100%) diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 8eb54f554e4..eec4ef4984f 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -14,7 +14,7 @@ OBJS=project.o option.o property.o main.o ioutils.o proitems.o \ QOBJS=qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtextstream.o qiodevice.o \ qringbuffer.o qdebug.o qmalloc.o qglobal.o \ qarraydata.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfiledevice.o qfile.o \ - qfilesystementry.o qfilesystemengine.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o \ + qfilesystementry.o qfilesystemengine.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o \ qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o \ qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o \ qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnumeric.o \ @@ -62,7 +62,7 @@ DEPEND_SRC = \ $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp \ $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp \ $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp $(SOURCE_PATH)/src/corelib/tools/qlist.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qvector.cpp $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \ + $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \ $(SOURCE_PATH)/src/corelib/io/qdiriterator.cpp \ $(SOURCE_PATH)/src/corelib/io/qdir.cpp $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp \ $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \ @@ -366,9 +366,6 @@ qtemporaryfile.o: $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp -qvector.o: $(SOURCE_PATH)/src/corelib/tools/qvector.cpp - $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qvector.cpp - qbitarray.o: $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index bb1f8aaabca..6d2bcdbb78e 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -106,7 +106,6 @@ QTOBJS= \ qtextstream.obj \ qdatastream.obj \ quuid.obj \ - qvector.obj \ qsettings.obj \ qvariant.obj \ qsettings_win.obj \ diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 288d99d8a26..c0f7250bcf3 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -68,7 +68,6 @@ bootstrap { #Qt code qlibraryinfo.cpp \ qsystemerror.cpp \ qvariant.cpp \ - qvector.cpp \ qvsnprintf.cpp \ qxmlstream.cpp \ qxmlutils.cpp \ diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.qdoc similarity index 100% rename from src/corelib/tools/qvector.cpp rename to src/corelib/tools/qvector.qdoc diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index fa8e07abbc6..1c9b34dacd8 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -110,7 +110,6 @@ SOURCES += \ tools/qtextboundaryfinder.cpp \ tools/qtimeline.cpp \ tools/qunicodetools.cpp \ - tools/qvector.cpp \ tools/qvsnprintf.cpp \ tools/qversionnumber.cpp diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index d51f9e98a45..2acc3fc77c5 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -78,7 +78,6 @@ SOURCES += \ ../../corelib/tools/qstringbuilder.cpp \ ../../corelib/tools/qstring_compat.cpp \ ../../corelib/tools/qstringlist.cpp \ - ../../corelib/tools/qvector.cpp \ ../../corelib/tools/qvsnprintf.cpp \ ../../corelib/xml/qxmlutils.cpp \ ../../corelib/xml/qxmlstream.cpp \ From 60563855e589cb51b4966ca51a4d390a2f1609a4 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 21 Oct 2016 18:52:54 +0300 Subject: [PATCH 16/29] Refactor QIODevice::read() Move device-dependent part of the code into the private function for further reusing by peek() procedure. Task-number: QTBUG-56032 Change-Id: Iedceafe4b0bab109ca5c64ad274d779efe87c27b Reviewed-by: Edward Welbourne --- src/corelib/io/qiodevice.cpp | 86 +++++++++++++++++++++--------------- src/corelib/io/qiodevice_p.h | 1 + 2 files changed, 51 insertions(+), 36 deletions(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 52a78ad1c48..8cef993cf4f 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1007,10 +1007,9 @@ qint64 QIODevice::read(char *data, qint64 maxSize) #endif const bool sequential = d->isSequential(); - const bool keepDataInBuffer = sequential && d->transactionStarted; - // Short circuit for getChar() - if (maxSize == 1 && !keepDataInBuffer) { + // Short-cut for getChar(), unless we need to keep the data in the buffer. + if (maxSize == 1 && !(sequential && d->transactionStarted)) { int chint; while ((chint = d->buffer.getChar()) != -1) { if (!sequential) @@ -1031,6 +1030,30 @@ qint64 QIODevice::read(char *data, qint64 maxSize) } CHECK_MAXLEN(read, qint64(-1)); + CHECK_READABLE(read, qint64(-1)); + + const qint64 readBytes = d->read(data, maxSize); + +#if defined QIODEVICE_DEBUG + printf("%p \treturning %lld, d->pos == %lld, d->buffer.size() == %lld\n", this, + readBytes, d->pos, d->buffer.size()); + if (readBytes > 0) + debugBinaryString(data - readBytes, readBytes); +#endif + + return readBytes; +} + +/*! + \internal +*/ +qint64 QIODevicePrivate::read(char *data, qint64 maxSize) +{ + Q_Q(QIODevice); + + const bool buffered = (openMode & QIODevice::Unbuffered) == 0; + const bool sequential = isSequential(); + const bool keepDataInBuffer = sequential && transactionStarted; qint64 readSoFar = 0; bool madeBufferReadsOnly = true; bool deviceAtEof = false; @@ -1038,36 +1061,33 @@ qint64 QIODevice::read(char *data, qint64 maxSize) forever { // Try reading from the buffer. qint64 bufferReadChunkSize = keepDataInBuffer - ? d->buffer.peek(data, maxSize, d->transactionPos) - : d->buffer.read(data, maxSize); + ? buffer.peek(data, maxSize, transactionPos) + : buffer.read(data, maxSize); if (bufferReadChunkSize > 0) { if (keepDataInBuffer) - d->transactionPos += bufferReadChunkSize; + transactionPos += bufferReadChunkSize; else if (!sequential) - d->pos += bufferReadChunkSize; + pos += bufferReadChunkSize; +#if defined QIODEVICE_DEBUG + printf("%p \treading %lld bytes from buffer into position %lld\n", q, + bufferReadChunkSize, readSoFar); +#endif readSoFar += bufferReadChunkSize; data += bufferReadChunkSize; maxSize -= bufferReadChunkSize; -#if defined QIODEVICE_DEBUG - printf("%p \treading %lld bytes from buffer into position %lld\n", this, - bufferReadChunkSize, readSoFar - bufferReadChunkSize); -#endif - } else { - CHECK_READABLE(read, qint64(-1)); } if (maxSize > 0 && !deviceAtEof) { qint64 readFromDevice = 0; // Make sure the device is positioned correctly. - if (sequential || d->pos == d->devicePos || seek(d->pos)) { + if (sequential || pos == devicePos || q->seek(pos)) { madeBufferReadsOnly = false; // fix readData attempt - if ((maxSize >= d->readBufferChunkSize || (d->openMode & Unbuffered)) - && !keepDataInBuffer) { + if ((!buffered || maxSize >= readBufferChunkSize) && !keepDataInBuffer) { // Read big chunk directly to output buffer - readFromDevice = readData(data, maxSize); + readFromDevice = q->readData(data, maxSize); deviceAtEof = (readFromDevice != maxSize); #if defined QIODEVICE_DEBUG - printf("%p \treading %lld bytes from device (total %lld)\n", this, + printf("%p \treading %lld bytes from device (total %lld)\n", q, readFromDevice, readSoFar); #endif if (readFromDevice > 0) { @@ -1075,24 +1095,24 @@ qint64 QIODevice::read(char *data, qint64 maxSize) data += readFromDevice; maxSize -= readFromDevice; if (!sequential) { - d->pos += readFromDevice; - d->devicePos += readFromDevice; + pos += readFromDevice; + devicePos += readFromDevice; } } } else { // Do not read more than maxSize on unbuffered devices - const qint64 bytesToBuffer = (d->openMode & Unbuffered) - ? qMin(maxSize, qint64(d->readBufferChunkSize)) - : qint64(d->readBufferChunkSize); + const qint64 bytesToBuffer = (buffered || readBufferChunkSize < maxSize) + ? qint64(readBufferChunkSize) + : maxSize; // Try to fill QIODevice buffer by single read - readFromDevice = readData(d->buffer.reserve(bytesToBuffer), bytesToBuffer); + readFromDevice = q->readData(buffer.reserve(bytesToBuffer), bytesToBuffer); deviceAtEof = (readFromDevice != bytesToBuffer); - d->buffer.chop(bytesToBuffer - qMax(Q_INT64_C(0), readFromDevice)); + buffer.chop(bytesToBuffer - qMax(Q_INT64_C(0), readFromDevice)); if (readFromDevice > 0) { if (!sequential) - d->devicePos += readFromDevice; + devicePos += readFromDevice; #if defined QIODEVICE_DEBUG - printf("%p \treading %lld from device into buffer\n", this, + printf("%p \treading %lld from device into buffer\n", q, readFromDevice); #endif continue; @@ -1108,7 +1128,7 @@ qint64 QIODevice::read(char *data, qint64 maxSize) } } - if ((d->openMode & Text) && readPtr < data) { + if ((openMode & QIODevice::Text) && readPtr < data) { const char *endPtr = data; // optimization to avoid initial self-assignment @@ -1140,14 +1160,8 @@ qint64 QIODevice::read(char *data, qint64 maxSize) break; } -#if defined QIODEVICE_DEBUG - printf("%p \treturning %lld, d->pos == %lld, d->buffer.size() == %lld\n", this, - readSoFar, d->pos, d->buffer.size()); - debugBinaryString(data - readSoFar, readSoFar); -#endif - - if (madeBufferReadsOnly && d->isBufferEmpty()) - readData(data, 0); + if (madeBufferReadsOnly && isBufferEmpty()) + q->readData(data, 0); return readSoFar; } diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h index 76bec89ef27..0e424b6831e 100644 --- a/src/corelib/io/qiodevice_p.h +++ b/src/corelib/io/qiodevice_p.h @@ -171,6 +171,7 @@ public: void setReadChannelCount(int count); void setWriteChannelCount(int count); + qint64 read(char *data, qint64 maxSize); virtual qint64 peek(char *data, qint64 maxSize); virtual QByteArray peek(qint64 maxSize); From 6e8fcab7e07717526c8ea6eac8785bf27fa090c3 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Sat, 17 Sep 2016 16:43:02 +0300 Subject: [PATCH 17/29] Improve QIODevice::peek() performance on buffered devices Since 5.7, QIODevice::peek() implementation is based on transaction mechanism. While technically it's correct, seeking backward on a buffered random-access device clears the internal buffer that affects the performance of reading. To solve the problem, this patch implements peek mode directly inside the reading procedure. Task-number: QTBUG-56032 Change-Id: Ic5269f76e44c491a0309e13aba87fa7cf7b9259f Reviewed-by: Edward Welbourne --- src/corelib/io/qiodevice.cpp | 83 +++++++++---------- src/corelib/io/qiodevice_p.h | 2 +- .../benchmarks/corelib/io/qiodevice/main.cpp | 32 +++++++ 3 files changed, 72 insertions(+), 45 deletions(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 8cef993cf4f..41a4d7a1ba3 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1047,26 +1047,29 @@ qint64 QIODevice::read(char *data, qint64 maxSize) /*! \internal */ -qint64 QIODevicePrivate::read(char *data, qint64 maxSize) +qint64 QIODevicePrivate::read(char *data, qint64 maxSize, bool peeking) { Q_Q(QIODevice); const bool buffered = (openMode & QIODevice::Unbuffered) == 0; const bool sequential = isSequential(); - const bool keepDataInBuffer = sequential && transactionStarted; + const bool keepDataInBuffer = sequential + ? peeking || transactionStarted + : peeking && buffered; + const qint64 savedPos = pos; qint64 readSoFar = 0; bool madeBufferReadsOnly = true; bool deviceAtEof = false; char *readPtr = data; + qint64 bufferPos = (sequential && transactionStarted) ? transactionPos : Q_INT64_C(0); forever { // Try reading from the buffer. qint64 bufferReadChunkSize = keepDataInBuffer - ? buffer.peek(data, maxSize, transactionPos) + ? buffer.peek(data, maxSize, bufferPos) : buffer.read(data, maxSize); if (bufferReadChunkSize > 0) { - if (keepDataInBuffer) - transactionPos += bufferReadChunkSize; - else if (!sequential) + bufferPos += bufferReadChunkSize; + if (!sequential) pos += bufferReadChunkSize; #if defined QIODEVICE_DEBUG printf("%p \treading %lld bytes from buffer into position %lld\n", q, @@ -1160,6 +1163,16 @@ qint64 QIODevicePrivate::read(char *data, qint64 maxSize) break; } + // Restore positions after reading + if (keepDataInBuffer) { + if (peeking) + pos = savedPos; // does nothing on sequential devices + else + transactionPos = bufferPos; + } else if (peeking) { + seekBuffer(savedPos); // unbuffered random-access device + } + if (madeBufferReadsOnly && isBufferEmpty()) q->readData(data, 0); @@ -1773,27 +1786,7 @@ bool QIODevicePrivate::putCharHelper(char c) */ qint64 QIODevicePrivate::peek(char *data, qint64 maxSize) { - Q_Q(QIODevice); - - if (transactionStarted) { - const qint64 savedTransactionPos = transactionPos; - const qint64 savedPos = pos; - - qint64 readBytes = q->read(data, maxSize); - - // Restore initial position - if (isSequential()) - transactionPos = savedTransactionPos; - else - seekBuffer(savedPos); - return readBytes; - } - - q->startTransaction(); - qint64 readBytes = q->read(data, maxSize); - q->rollbackTransaction(); - - return readBytes; + return read(data, maxSize, true); } /*! @@ -1801,26 +1794,17 @@ qint64 QIODevicePrivate::peek(char *data, qint64 maxSize) */ QByteArray QIODevicePrivate::peek(qint64 maxSize) { - Q_Q(QIODevice); + QByteArray result(maxSize, Qt::Uninitialized); - if (transactionStarted) { - const qint64 savedTransactionPos = transactionPos; - const qint64 savedPos = pos; + const qint64 readBytes = read(result.data(), maxSize, true); - QByteArray result = q->read(maxSize); - - // Restore initial position - if (isSequential()) - transactionPos = savedTransactionPos; + if (readBytes < maxSize) { + if (readBytes <= 0) + result.clear(); else - seekBuffer(savedPos); - return result; + result.resize(readBytes); } - q->startTransaction(); - QByteArray result = q->read(maxSize); - q->rollbackTransaction(); - return result; } @@ -1858,7 +1842,12 @@ bool QIODevice::getChar(char *c) */ qint64 QIODevice::peek(char *data, qint64 maxSize) { - return d_func()->peek(data, maxSize); + Q_D(QIODevice); + + CHECK_MAXLEN(peek, qint64(-1)); + CHECK_READABLE(peek, qint64(-1)); + + return d->peek(data, maxSize); } /*! @@ -1880,7 +1869,13 @@ qint64 QIODevice::peek(char *data, qint64 maxSize) */ QByteArray QIODevice::peek(qint64 maxSize) { - return d_func()->peek(maxSize); + Q_D(QIODevice); + + CHECK_MAXLEN(peek, QByteArray()); + CHECK_MAXBYTEARRAYSIZE(peek); + CHECK_READABLE(peek, QByteArray()); + + return d->peek(maxSize); } /*! diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h index 0e424b6831e..71a326dd53e 100644 --- a/src/corelib/io/qiodevice_p.h +++ b/src/corelib/io/qiodevice_p.h @@ -171,7 +171,7 @@ public: void setReadChannelCount(int count); void setWriteChannelCount(int count); - qint64 read(char *data, qint64 maxSize); + qint64 read(char *data, qint64 maxSize, bool peeking = false); virtual qint64 peek(char *data, qint64 maxSize); virtual QByteArray peek(qint64 maxSize); diff --git a/tests/benchmarks/corelib/io/qiodevice/main.cpp b/tests/benchmarks/corelib/io/qiodevice/main.cpp index b106a9fd3df..de4660a253e 100644 --- a/tests/benchmarks/corelib/io/qiodevice/main.cpp +++ b/tests/benchmarks/corelib/io/qiodevice/main.cpp @@ -39,6 +39,8 @@ class tst_qiodevice : public QObject private slots: void read_old(); void read_old_data() { read_data(); } + void peekAndRead(); + void peekAndRead_data() { read_data(); } //void read_new(); //void read_new_data() { read_data(); } private: @@ -86,6 +88,36 @@ void tst_qiodevice::read_old() } } +void tst_qiodevice::peekAndRead() +{ + QFETCH(qint64, size); + + QString name = "tmp" + QString::number(size); + + { + QFile file(name); + file.open(QIODevice::WriteOnly); + file.seek(size); + file.write("x", 1); + file.close(); + } + + QBENCHMARK { + QFile file(name); + file.open(QIODevice::ReadOnly); + + QByteArray ba(size / 1024, Qt::Uninitialized); + while (!file.atEnd()) { + file.peek(ba.data(), ba.size()); + file.read(ba.data(), ba.size()); + } + } + + { + QFile file(name); + file.remove(); + } +} QTEST_MAIN(tst_qiodevice) From 68b21690e25533e0c35f4e29f6b373fb09b117a3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 6 Feb 2017 15:50:17 -0800 Subject: [PATCH 18/29] Use QBasicMutex in qthread_win.cpp It's QtCore, so we're fine. Change-Id: Ifaee7464122d402991b6fffd14a0d7ad9c09e2f2 Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/thread/qthread_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index a14c193badd..e6c70ecb550 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -96,7 +96,7 @@ void qt_create_tls() { if (qt_current_thread_data_tls_index != TLS_OUT_OF_INDEXES) return; - static QMutex mutex; + static QBasicMutex mutex; QMutexLocker locker(&mutex); qt_current_thread_data_tls_index = TlsAlloc(); } @@ -166,7 +166,7 @@ void QAdoptedThread::init() static QVector qt_adopted_thread_handles; static QVector qt_adopted_qthreads; -static QMutex qt_adopted_thread_watcher_mutex; +static QBasicMutex qt_adopted_thread_watcher_mutex; static DWORD qt_adopted_thread_watcher_id = 0; static HANDLE qt_adopted_thread_wakeup = 0; From b0c1e07d648caf585d2be12cf3d18eb42b86f721 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 7 Feb 2017 13:10:38 +0100 Subject: [PATCH 19/29] Add tests for QCollatorSortKey There weren't any, at all. Testing on the CI showed that the implementation is broken on macOS, and, to a lesser extent, on Windows, so blacklist the failing tests until the implementation can be fixed. No need to hold back testing the other implementations. Task-number: QTBUG-58737 Change-Id: I9ae16ab778dbe2e95a6ca5e0bae00df4bad65cb2 Reviewed-by: Edward Welbourne --- tests/auto/corelib/tools/qcollator/BLACKLIST | 18 ++++++++++++ .../corelib/tools/qcollator/tst_qcollator.cpp | 28 +++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 tests/auto/corelib/tools/qcollator/BLACKLIST diff --git a/tests/auto/corelib/tools/qcollator/BLACKLIST b/tests/auto/corelib/tools/qcollator/BLACKLIST new file mode 100644 index 00000000000..09b69e0108e --- /dev/null +++ b/tests/auto/corelib/tools/qcollator/BLACKLIST @@ -0,0 +1,18 @@ +[compare:swedish5] +osx +[compare:norwegian4] +osx +[compare:german6] +osx +windows +[compare:german7] +osx +windows +[compare:german8] +osx +[compare:german9] +osx +[compare:german10] +osx +[compare:french5] +osx diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index d09910fd5c3..ead0992f922 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -33,6 +33,11 @@ #include +Q_CONSTEXPR inline int sign(int i) Q_DECL_NOTHROW +{ return i < 0 ? -1 : i > 0 ? 1 : 0; } + +#define QCOMPARE_SIGN(x, y) QCOMPARE(sign(x), sign(y)) + class tst_QCollator : public QObject { Q_OBJECT @@ -173,9 +178,28 @@ void tst_QCollator::compare() if (numericMode) collator.setNumericMode(true); - QCOMPARE(collator.compare(s1, s2), result); + QCOMPARE_SIGN(collator.compare(s1, s2), result); + { + const auto s1sk = collator.sortKey(s1); + const auto s2sk = collator.sortKey(s2); + + QCOMPARE_SIGN(s1sk.compare(s2sk), result); +#define CHECK(op) QCOMPARE(s1sk op s2sk, result op 0) + CHECK(<); +#undef CHECK + } + collator.setCaseSensitivity(Qt::CaseInsensitive); - QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult); + QCOMPARE_SIGN(collator.compare(s1, s2), caseInsensitiveResult); + { + const auto s1sk = collator.sortKey(s1); + const auto s2sk = collator.sortKey(s2); + + QCOMPARE_SIGN(s1sk.compare(s2sk), caseInsensitiveResult); +#define CHECK(op) QCOMPARE(s1sk op s2sk, caseInsensitiveResult op 0) + CHECK(<); +#undef CHECK + } } From b1b53b7101b800aa7f2b749ffcead8a124c0a5f1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 12 Feb 2017 08:15:20 +0000 Subject: [PATCH 20/29] Revert "Add tests for QCollatorSortKey" This reverts commit b0c1e07d648caf585d2be12cf3d18eb42b86f721. The unit tests it introduced trigger errors with the macOS and Win32 implementations, which means the there's something seriously wrong with either the API, our implementation or the tests. Revert for now until this gets fixed. Blacklisting was also the wrong tool to use. The tests should have used QEXPECT_FAIL. Change-Id: Ida20c6bbe0c019835a22464535029585e8e1e367 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qcollator/BLACKLIST | 18 ------------ .../corelib/tools/qcollator/tst_qcollator.cpp | 28 ++----------------- 2 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 tests/auto/corelib/tools/qcollator/BLACKLIST diff --git a/tests/auto/corelib/tools/qcollator/BLACKLIST b/tests/auto/corelib/tools/qcollator/BLACKLIST deleted file mode 100644 index 09b69e0108e..00000000000 --- a/tests/auto/corelib/tools/qcollator/BLACKLIST +++ /dev/null @@ -1,18 +0,0 @@ -[compare:swedish5] -osx -[compare:norwegian4] -osx -[compare:german6] -osx -windows -[compare:german7] -osx -windows -[compare:german8] -osx -[compare:german9] -osx -[compare:german10] -osx -[compare:french5] -osx diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index ead0992f922..d09910fd5c3 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -33,11 +33,6 @@ #include -Q_CONSTEXPR inline int sign(int i) Q_DECL_NOTHROW -{ return i < 0 ? -1 : i > 0 ? 1 : 0; } - -#define QCOMPARE_SIGN(x, y) QCOMPARE(sign(x), sign(y)) - class tst_QCollator : public QObject { Q_OBJECT @@ -178,28 +173,9 @@ void tst_QCollator::compare() if (numericMode) collator.setNumericMode(true); - QCOMPARE_SIGN(collator.compare(s1, s2), result); - { - const auto s1sk = collator.sortKey(s1); - const auto s2sk = collator.sortKey(s2); - - QCOMPARE_SIGN(s1sk.compare(s2sk), result); -#define CHECK(op) QCOMPARE(s1sk op s2sk, result op 0) - CHECK(<); -#undef CHECK - } - + QCOMPARE(collator.compare(s1, s2), result); collator.setCaseSensitivity(Qt::CaseInsensitive); - QCOMPARE_SIGN(collator.compare(s1, s2), caseInsensitiveResult); - { - const auto s1sk = collator.sortKey(s1); - const auto s2sk = collator.sortKey(s2); - - QCOMPARE_SIGN(s1sk.compare(s2sk), caseInsensitiveResult); -#define CHECK(op) QCOMPARE(s1sk op s2sk, caseInsensitiveResult op 0) - CHECK(<); -#undef CHECK - } + QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult); } From 418184c2a0ad97cce12717a43f84fa6f12ece189 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 27 Jan 2017 11:26:42 -0800 Subject: [PATCH 21/29] Update the __xxx__ macros due to MSVC and ICC not defining them all And if __AES__ or __PCLMUL__ is defined, then we expect wmmintrin.h to exist. Change-Id: I445bb15619f6401494e8fffd149db77dc513e071 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/tools/qsimd_p.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index be53c51c483..f6164e22970 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -230,12 +230,39 @@ // SSE4.2 intrinsics #if defined(__SSE4_2__) || (defined(QT_COMPILER_SUPPORTS_SSE4_2) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) #include + +# if defined(__SSE4_2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) +// POPCNT instructions: +// All processors that support SSE4.2 support POPCNT +// (but neither MSVC nor the Intel compiler define this macro) +# define __POPCNT__ 1 +# endif #endif // AVX intrinsics #if defined(__AVX__) || (defined(QT_COMPILER_SUPPORTS_AVX) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) // immintrin.h is the ultimate header, we don't need anything else after this #include + +# if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) +// AES, PCLMULQDQ instructions: +// All processors that support AVX support AES, PCLMULQDQ +// (but neither MSVC nor the Intel compiler define these macros) +# define __AES__ 1 +# define __PCLMUL__ 1 +# endif + +# if defined(__AVX2__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) +// F16C & RDRAND instructions: +// All processors that support AVX2 support F16C & RDRAND: +// (but neither MSVC nor the Intel compiler define these macros) +# define __F16C__ 1 +# define __RDRND__ 1 +# endif +#endif + +#if defined(__AES__) || defined(__PCLMUL__) +# include #endif #define QT_FUNCTION_TARGET_STRING_SSE2 "sse2" @@ -255,7 +282,10 @@ #define QT_FUNCTION_TARGET_STRING_AVX512IFMA "avx512ifma" #define QT_FUNCTION_TARGET_STRING_AVX512VBMI "avx512vbmi" -#define QT_FUNCTION_TARGET_STRING_F16C "f16c" +#define QT_FUNCTION_TARGET_STRING_AES "aes,sse4.2" +#define QT_FUNCTION_TARGET_STRING_PCLMUL "pclmul,sse4.2" +#define QT_FUNCTION_TARGET_STRING_POPCNT "popcnt" +#define QT_FUNCTION_TARGET_STRING_F16C "f16c,avx" #define QT_FUNCTION_TARGET_STRING_RDRAND "rdrnd" #define QT_FUNCTION_TARGET_STRING_BMI "bmi" #define QT_FUNCTION_TARGET_STRING_BMI2 "bmi2" From b2ffc4d0a0c7e498da68851b97963a8b7534847d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 10 Feb 2017 20:44:11 -0800 Subject: [PATCH 22/29] moc: remember to quote the path to moc_predefs.h Task-number: QTBUG-58764 Change-Id: I4baef2edf7624ad69d96fffd14a22209a2bb90be Reviewed-by: Olivier Goffart (Woboq GmbH) --- mkspecs/features/moc.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 825c7069503..cded960de11 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -57,7 +57,7 @@ defineReplace(mocCmdBase) { msvc: RET += --compiler-flavor=msvc isEmpty(MOC_PREDEF_FILE): RET += $$join(QMAKE_COMPILER_DEFINES, " -D", -D) - else: RET += --include $$moc_predefs.output + else: RET += --include $$shell_quote($$moc_predefs.output) RET += $$incvar $$QMAKE_MOC_OPTIONS return($$RET) From 9db8c171e7bd775ed4cf5281fe17f8084c0ffbcd Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Thu, 23 Jun 2016 15:01:40 +0200 Subject: [PATCH 23/29] Fix QLibrary::isLibrary on Apple platforms Add proper support for 'so' and 'bundle' suffixes. Qt wrongly assumes .so libraries are not versioned on Apple platforms, which is wrong. Also, the shared library .bundle which is what Apple recommends instead of .so, are also versioned (not to be confound with the different Core Foundation bundles, which are directory hierarchy). For more info, see http://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm. Especially the part that reads: "Loadable modules, called bundles in Mac OS X, have the file type MH_BUNDLE. Most Unix-based software ports usually produce bundles with a .so extension, for the sake of consistency across platforms. Although Apple recommends giving bundles a .bundle extension, it isn't mandatory." Task-number: QTBUG-50446 Change-Id: Iacd5136397a12d65d83821434f332eb602550b4b Reviewed-by: Thiago Macieira --- src/corelib/plugin/qlibrary.cpp | 36 ++++++++----------- .../corelib/plugin/qlibrary/tst_qlibrary.cpp | 9 ++--- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index aff2991ed1d..96cf5371f9b 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -617,40 +617,34 @@ bool QLibrary::isLibrary(const QString &fileName) { #if defined(Q_OS_WIN) return fileName.endsWith(QLatin1String(".dll"), Qt::CaseInsensitive); -#else +#else // Generic Unix QString completeSuffix = QFileInfo(fileName).completeSuffix(); if (completeSuffix.isEmpty()) return false; const QVector suffixes = completeSuffix.splitRef(QLatin1Char('.')); -# if defined(Q_OS_DARWIN) - - // On Mac, libs look like libmylib.1.0.0.dylib - const QStringRef &lastSuffix = suffixes.at(suffixes.count() - 1); - const QStringRef &firstSuffix = suffixes.at(0); - - bool valid = (lastSuffix == QLatin1String("dylib") - || firstSuffix == QLatin1String("so") - || firstSuffix == QLatin1String("bundle")); - - return valid; -# else // Generic Unix QStringList validSuffixList; -# if defined(Q_OS_HPUX) +# if defined(Q_OS_HPUX) /* See "HP-UX Linker and Libraries User's Guide", section "Link-time Differences between PA-RISC and IPF": "In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit), the shared libraries are suffixed with .so. For compatibility, the IPF linker also supports the .sl suffix." */ validSuffixList << QLatin1String("sl"); -# if defined __ia64 - validSuffixList << QLatin1String("so"); -# endif -# elif defined(Q_OS_AIX) - validSuffixList << QLatin1String("a") << QLatin1String("so"); -# elif defined(Q_OS_UNIX) +# if defined __ia64 validSuffixList << QLatin1String("so"); # endif +# elif defined(Q_OS_AIX) + validSuffixList << QLatin1String("a") << QLatin1String("so"); +# elif defined(Q_OS_DARWIN) + // On Apple platforms, dylib look like libmylib.1.0.0.dylib + if (suffixes.last() == QLatin1String("dylib")) + return true; + + validSuffixList << QLatin1String("so") << QLatin1String("bundle"); +# elif defined(Q_OS_UNIX) + validSuffixList << QLatin1String("so"); +# endif // Examples of valid library names: // libfoo.so @@ -669,9 +663,7 @@ bool QLibrary::isLibrary(const QString &fileName) if (i != suffixPos) suffixes.at(i).toInt(&valid); return valid; -# endif #endif - } typedef const char * (*QtPluginQueryVerificationDataFunction)(); diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index 42fed1191b9..16177bb0b76 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -302,15 +302,10 @@ void tst_QLibrary::isLibrary_data() QTest::newRow(".sl") << QString("mylib.sl") << sl_VALID; QTest::newRow(".so") << QString("mylib.so") << so_VALID; QTest::newRow(".so+version") << QString("mylib.so.0") << so_VALID; - - // special tests: -#ifndef Q_OS_MAC QTest::newRow("version+.so") << QString("libc-2.7.so") << so_VALID; QTest::newRow("version+.so+version") << QString("liboil-0.3.so.0.1.0") << so_VALID; -#else - QTest::newRow("version+.so") << QString("libc-2.7.so") << false; - QTest::newRow("version+.so+version") << QString("liboil-0.3.so.0.1.0") << false; -#endif + + // special tests: #ifdef Q_OS_MAC QTest::newRow("good (libmylib.1.0.0.dylib)") << QString("libmylib.1.0.0.dylib") << true; QTest::newRow("good (libmylib.dylib)") << QString("libmylib.dylib") << true; From 088bf1fb3da72d5c153e5ce16431cc6d96159eae Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Tue, 7 Feb 2017 13:56:02 +0100 Subject: [PATCH 24/29] Add the new NVIDIA specific calls to qeglstreamconvenience NVIDIA 370 introduced new calls needed to work with eglstreams in the wayland window system Task-number: QTBUG-58299 Change-Id: I606b143d3016f365b0d5ca4bc163b99289afbea1 Reviewed-by: Laszlo Agocs --- .../eglconvenience/qeglstreamconvenience.cpp | 5 +++++ .../eglconvenience/qeglstreamconvenience_p.h | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp b/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp index 1e90f849f54..5c336f05537 100644 --- a/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp +++ b/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp @@ -103,6 +103,11 @@ void QEGLStreamConvenience::initialize(EGLDisplay dpy) stream_consumer_gltexture = reinterpret_cast(eglGetProcAddress("eglStreamConsumerGLTextureExternalKHR")); stream_consumer_acquire = reinterpret_cast(eglGetProcAddress("eglStreamConsumerAcquireKHR")); stream_consumer_release = reinterpret_cast(eglGetProcAddress("eglStreamConsumerReleaseKHR")); + create_stream_attrib_nv = reinterpret_cast(eglGetProcAddress("eglCreateStreamAttribNV")); + set_stream_attrib_nv = reinterpret_cast(eglGetProcAddress("eglSetStreamAttribNV")); + query_stream_attrib_nv = reinterpret_cast(eglGetProcAddress("eglQueryStreamAttribNV")); + acquire_stream_attrib_nv = reinterpret_cast(eglGetProcAddress("eglStreamConsumerAcquireAttribNV")); + release_stream_attrib_nv = reinterpret_cast(eglGetProcAddress("eglStreamConsumerReleaseAttribNV")); has_egl_stream = strstr(extensions, "EGL_KHR_stream"); has_egl_stream_producer_eglsurface = strstr(extensions, "EGL_KHR_stream_producer_eglsurface"); diff --git a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h index 8c802a0ca18..c3d30702102 100644 --- a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h +++ b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h @@ -148,6 +148,14 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay #define EGL_PLATFORM_X11_KHR 0x31D5 #endif +#ifndef EGL_NV_stream_attrib +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMATTRIBNVPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); +#endif + QT_BEGIN_NAMESPACE class QEGLStreamConvenience @@ -160,6 +168,11 @@ public: PFNEGLQUERYDEVICESEXTPROC query_devices; PFNEGLQUERYDEVICESTRINGEXTPROC query_device_string; PFNEGLCREATESTREAMKHRPROC create_stream; + PFNEGLCREATESTREAMATTRIBNVPROC create_stream_attrib_nv; + PFNEGLSETSTREAMATTRIBNVPROC set_stream_attrib_nv; + PFNEGLQUERYSTREAMATTRIBNVPROC query_stream_attrib_nv; + PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC acquire_stream_attrib_nv; + PFNEGLSTREAMCONSUMERRELEASEATTRIBNVPROC release_stream_attrib_nv; PFNEGLDESTROYSTREAMKHRPROC destroy_stream; PFNEGLSTREAMATTRIBKHRPROC stream_attrib; PFNEGLQUERYSTREAMKHRPROC query_stream; From e3e2bc21097ee20f038c15f699e829c292251c18 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 13 Feb 2017 09:57:02 +0100 Subject: [PATCH 25/29] announce 'temporaryfile' feature in bootstrap library qmldevtools refers to it. Task-number: QTBUG-58819 Change-Id: Id88265bb17e4d2e9c61f77409c4163eacc4a13f3 Reviewed-by: Lars Knoll --- src/corelib/global/qconfig-bootstrapped.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index d7849d4699c..1c806e07742 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -77,6 +77,7 @@ #define QT_NO_SYSTEMLOCALE #define QT_FEATURE_slog2 -1 #define QT_FEATURE_syslog -1 +#define QT_FEATURE_temporaryfile 1 #define QT_NO_THREAD #define QT_FEATURE_timezone -1 #define QT_FEATURE_topleveldomain -1 From e8a2a9bf307de0bd174e438c87045ca1b846d73e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 9 Feb 2017 08:40:50 +0100 Subject: [PATCH 26/29] Windows QPA: Include GL header depending on presence of dynamic GL Amends change 7780ee9e5f20f80ab9e053058d0b6d92586cf876. Task-number: QTBUG-58178 Change-Id: I0b6e064dfdbdafb7fba9c20c56cfd873fa594c44 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index b5522c1f90e..48835f26a60 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -43,7 +43,11 @@ #include "qwindowsscreen.h" #include "qwindowsintegration.h" #include "qwindowsnativeinterface.h" -#include "qwindowsglcontext.h" +#if QT_CONFIG(dynamicgl) +# include "qwindowsglcontext.h" +#else +# include "qwindowsopenglcontext.h" +#endif #ifdef QT_NO_CURSOR # include "qwindowscursor.h" #endif From 6fe386ac426a7ac41be57e15b02041ff809c8eac Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 17 Jan 2017 16:40:56 +0100 Subject: [PATCH 27/29] Doc: Updated doc QSqlDatabase Change-Id: I914e9bdbf6137f0e3858a57b0f59fc550fc7e317 Reviewed-by: Venugopal Shivashankar --- src/sql/kernel/qsqldatabase.cpp | 79 +++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index d91e502b96f..0416215870e 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -313,7 +313,7 @@ void QSqlDatabasePrivate::disable() /*! \class QSqlDatabase - \brief The QSqlDatabase class represents a connection to + \brief The QSqlDatabase class handles a connection to a database. \ingroup database @@ -332,18 +332,17 @@ void QSqlDatabasePrivate::disable() Create a connection (i.e., an instance of QSqlDatabase) by calling one of the static addDatabase() functions, where you specify \l{SQL Database Drivers#Supported Databases} {the driver or type - of driver} to use (i.e., what kind of database will you access?) + of driver} to use (depending on the type of database) and a connection name. A connection is known by its own name, \e{not} by the name of the database it connects to. You can have multiple connections to one database. QSqlDatabase also supports the concept of a \e{default} connection, which is the unnamed connection. To create the default connection, don't pass the connection name argument when you call addDatabase(). - Subsequently, when you call any static member function that takes - the connection name argument, if you don't pass the connection - name argument, the default connection is assumed. The following - snippet shows how to create and open a default connection to a - PostgreSQL database: + Subsequently, the default connection will be assumed if you call + any static member function without specifying the connection name. + The following snippet shows how to create and open a default connection + to a PostgreSQL database: \snippet sqldatabase/sqldatabase.cpp 0 @@ -374,27 +373,50 @@ void QSqlDatabasePrivate::disable() referenced by other QSqlDatabase objects. Use contains() to see if a given connection name is in the list of connections. - Once a connection is established, you can call tables() to get the - list of tables in the database, call primaryIndex() to get a - table's primary index, and call record() to get meta-information - about a table's fields (e.g., field names). + \table + \header + \li {2,1}Some utility methods: + \row + \li tables() + \li returns the list of tables + \row + \li primaryIndex() + \li returns a table's primary index + \row + \li record() + \li returns meta-information about a table's fields + \row + \li transaction() + \li starts a transaction + \row + \li commit() + \li saves and completes a transaction + \row + \li rollback() + \li cancels a transaction + \row + \li hasFeature() + \li checks if a driver supports transactions + \row + \li lastError() + \li returns information about the last error + \row + \li drivers() + \li returns the names of the available SQL drivers + \row + \li isDriverAvailable() + \li checks if a particular driver is available + \row + \li registerSqlDriver() + \li registers a custom-made driver + \endtable \note QSqlDatabase::exec() is deprecated. Use QSqlQuery::exec() instead. - If the driver supports transactions, use transaction() to start a - transaction, and commit() or rollback() to complete it. Use - \l{QSqlDriver::} {hasFeature()} to ask if the driver supports - transactions. \note When using transactions, you must start the + \note When using transactions, you must start the transaction before you create your query. - If an error occurs, lastError() will return information about it. - - Get the names of the available SQL drivers with drivers(). Check - for the presence of a particular driver with isDriverAvailable(). - If you have created your own custom driver, you must register it - with registerSqlDriver(). - \sa QSqlDriver, QSqlQuery, {Qt SQL}, {Threads and the SQL Module} */ @@ -963,9 +985,9 @@ QString QSqlDatabase::userName() const } /*! - Returns the connection's password. If the password was not set - with setPassword(), and if the password was given in the open() - call, or if no password was used, an empty string is returned. + Returns the connection's password. An empty string will be returned + if the password was not set with setPassword(), and if the password + was given in the open() call, or if no password was used. */ QString QSqlDatabase::password() const { @@ -1045,7 +1067,7 @@ QStringList QSqlDatabase::tables(QSql::TableType type) const /*! Returns the primary index for table \a tablename. If no primary - index exists an empty QSqlIndex is returned. + index exists, an empty QSqlIndex is returned. \sa tables(), record() */ @@ -1071,8 +1093,9 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const /*! Sets database-specific \a options. This must be done before the - connection is opened or it has no effect (or you can close() the - connection, call this function and open() the connection again). + connection is opened, otherwise it has no effect. Another possibility + is to close the connection, call QSqlDatabase::setConnectOptions(), + and open() the connection again. The format of the \a options string is a semicolon separated list of option names or option=value pairs. The options depend on the From aa1631d76c37793941b7dc343141962ccf0488be Mon Sep 17 00:00:00 2001 From: Julien Gueytat Date: Sat, 11 Feb 2017 18:48:50 +0100 Subject: [PATCH 28/29] Replace gstrip by strip due to ELF corruption This is an old error of the gstrip binutils. The bug has been corrected and re-introduced. The command *elfdump -d xxx* on the ELF does bring lines like those : .SUNW_syminfo: invalid sh_info: 0 Task-number: QTBUG-58814 Change-Id: I330c4031dcf4ba64297df4b333b41cf0a003914f Reviewed-by: Oswald Buddenhagen --- mkspecs/common/solaris.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/common/solaris.conf b/mkspecs/common/solaris.conf index b53227204d7..23e26debffa 100644 --- a/mkspecs/common/solaris.conf +++ b/mkspecs/common/solaris.conf @@ -29,5 +29,5 @@ QMAKE_OBJCOPY = objcopy QMAKE_NM = nm -P QMAKE_RANLIB = -QMAKE_STRIP = gstrip -QMAKE_STRIPFLAGS_LIB += --strip-unneeded +QMAKE_STRIP = strip +QMAKE_STRIPFLAGS_LIB += From 10ecbc4041cb7db004f4ed4d40ce082553d75844 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 8 Feb 2017 12:04:54 +0100 Subject: [PATCH 29/29] Blacklist tst_QWaitCondition::wakeOne() on Windows This test was determined to be flaky on the CI. Task-number: QTBUG-58741 Change-Id: I43196d3a27f726fb96b427f5071e726b571a0404 Reviewed-by: Friedemann Kleint Reviewed-by: David Faure --- tests/auto/corelib/thread/qwaitcondition/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/corelib/thread/qwaitcondition/BLACKLIST diff --git a/tests/auto/corelib/thread/qwaitcondition/BLACKLIST b/tests/auto/corelib/thread/qwaitcondition/BLACKLIST new file mode 100644 index 00000000000..3ff336576b3 --- /dev/null +++ b/tests/auto/corelib/thread/qwaitcondition/BLACKLIST @@ -0,0 +1,2 @@ +[wakeOne] +windows