Commit Graph

39872 Commits

Author SHA1 Message Date
Alexandru Croitor
e7c992755e Turn off linker version script support on macOS
The test erroneously succeeds on macOS with an XCode generator.
Explicitly set the test result to be turned off.

Change-Id: Id6fcb96f420f611517e81cc3697f1c88b508bd7c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-09 14:26:14 +00:00
Liang Qi
677a7a3066 CMake: Fix mappings in helper.py - WUIAS
This amends 9afc605eb5.

Change-Id: If246811d267d091c692875a1645c96767f781010
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-09 14:26:05 +00:00
Alexandru Croitor
b7a55b0931 On second thought, install tracegen and qfloat16-tables tools
They are not needed per se for a host build, but they are still
needed for a cross build (because we don't build tools in that
case).

Task-number: QTBUG-74133
Change-Id: I891e3852c6846119956982a7bdbf449ad7c4836c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-09 14:26:04 +00:00
Friedemann Kleint
434c866e1b QtGui: Use member initialization for QWindowPrivate, QScreenPrivate
Remove the constructors, destructors in favor of member initialization.

Change-Id: I323826328fb783ea2cd931c0e6aad45a98a2ebeb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-09 14:23:04 +00:00
Allan Sandfeld Jensen
0bee05f4c1 Make the 64 bit raster backend an optional feature
Can be used to make smaller binaries, and possibly speed up ARGB32
rendering on some platforms.

Change-Id: I7647b197ba7a6582187cc9736b7e0d752bd5bee5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-04-09 12:53:19 +00:00
Friedemann Kleint
84ce5022ce QFileDialog (widgets-based): Remember selection in history
Extend the history by a persistent model index list
reflecting the selection.

[ChangeLog][QtWidgets][QFileDialog] The widgets-based dialog now
remembers the selected files when navigating the history

Fixes: QTBUG-71415
Change-Id: I86774439be070c1b922acd0e9a27d029f02f68d3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-04-09 11:15:36 +00:00
Tobias Hunger
f233249207 CMake: FindATSPI2: Ignore repeated attempts to find ATSPI2
Change-Id: I4d6f59d144910d2f194f73e3b9bc8a5cc6726bcd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-09 11:14:12 +00:00
Tobias Hunger
511124bf1d CMake: pro2cmake.py: Fix plugin type only prints first letter
Change-Id: Ib8989d2c13199d804d0c069903ca1c5eb61763e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-09 09:54:23 +00:00
Liang Qi
341729db15 cmake: use WindowsUIAutomationSupportPrivate for windows plugin
Change-Id: Ie7d74ff3431b1ac9bac4255d561ae2c2fb28550a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-09 09:22:42 +00:00
Edward Welbourne
6d4a456a28 Fix off-by-one error in QTranslatorPrivate::do_load()
The central loop starts by reading five bytes; but
the loop condition only checked that four were available.

Change-Id: I244cecacabeffbac10ad94081f32847f912d95d9
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk@qt.io>
2019-04-09 09:12:11 +00:00
Alexandru Croitor
f0cc730197 Fix FindWrapOpenGL to choose the correct GL implementation
The find_package() call for WrapOpenGL was moved to the beginning of
the src/gui project file. This was incorrect, because the features
were not yet computed at that time, and the find module was incorrectly
always choosing the Desktop GL implementation.

Move the find_package() after the add_qt_module() call.

Amends 4f736db08c.

Task-number: QTBUG-74133
Change-Id: Ice1da8f23275843c7285ec748e6d673edbffffac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-09 08:52:18 +00:00
Joerg Bornemann
9617791075 Let QINSTALL copy hidden files when installing directories
When installing directories, QINSTALL must not ignore contained hidden
files to be consistent with the old INSTALL_DIR.

Fixes: QTBUG-66835
Change-Id: I3a7c952dcac9732d5b17c5a258f87ca277b388d2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-09 08:16:25 +00:00
Tobias Hunger
9afc605eb5 CMake: Fix mappings in helper.py
Some of the Qt names were wrong. Fix them and remove the work-arounds
in the library mappings.

Change-Id: I9b9afa3fb35c578e5c8d9cdef77224eb072ec8da
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:29:21 +00:00
Tobias Hunger
3bc9586e61 CMake: pro2cmake.py: Move defines from QMAKE_CXX_FLAGS into DEFINES
Change-Id: If3bfe715032b21dc046e63a79b0318a161d7a371
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:29:08 +00:00
Tobias Hunger
3cf92ab183 CMake: pro2cmake.py: Better separation between public and private libraries
Change-Id: I95a941ae92a77e049437d3cdd7d06eece11588f4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:58 +00:00
Tobias Hunger
8c28c85465 CMake: pro2cmake.py: Strip '-D' from compile options
Change-Id: I8239d36dc6af1b5eeded7f293dd6c151c10e289f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:44 +00:00
Tobias Hunger
9d83b54015 CMake: pro2cmake.py: Fix handling of file paths
This patch makes sure to store unchanged filenames as taken from qmake
into the scopes it creates.

The scopes are then kept longer: Merging/including scopes is handled by
adding the scope to a private _included_children member of the parent scope.

The methods to access data from scopes are then changed to take the
_included_children into account and a new "get_files" method is added,
that does all the necessary mapping to handle scope-dependent things like
$$PWD, etc.

This makes sure src/network is converted correctly incl. all the .pri-files it
includes as well as src/platformsupport/themes.pro. Both have been troublesome
before.

Change-Id: I28e92b7bcee1b91b248c17201c2729a54a3ce4a1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:30 +00:00
Tobias Hunger
52f676bf66 CMake: pro2cmake.py: Better representation of scopes as str
Include the current directory in the scope __repr__ output to make
it easier to understand where things wrt. include or file names go
wrong.

Change-Id: I09a6c17c6d8d547f1f64801bcde3c2e10c925ee1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:18 +00:00
Tobias Hunger
77a465ea2d CMake: pro2cmake.py: Better handling of debug features
Improve way that debug features are detected.

Change-Id: Ic0f0e74885e6d1e7f236c9efe4c77482ac212dbc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:08 +00:00
Tobias Hunger
9365a01531 CMake: pro2cmake.py: Fix typing information
Change-Id: Iaa6ea69c3c72eb1b626a976fcdb16243f15c609e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:27:59 +00:00
Tobias Hunger
81542ffb91 CMake: Map linuxaccessibility_supportPrivate to Qt::LASP
Change-Id: I6066f69c74c39fb97a286eb92748b5c4172b1efd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:27:48 +00:00
Kai Koehne
7482602e85 ANGLE: Remove superfluous -Gm- option
/GM at one point apparently was set by default for debug builds. However,
nowaways it's officially deprecated and even generates a warning in
Visual Studio 2019; so we don't have to 'unset' it specifically anymore.

Change-Id: I5b9b93c058c2ee8a5e025da43251d3859acbe061
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-09 07:00:25 +00:00
Kai Koehne
8cd0a39dd7 qmake: Remove special-handling of cl.exe's -Gm option
The comment hints that it's fixing an issue in Visual Studio 2013, which
we don't support anymore.

In all supported Visual Studio Versions -Gm is actually deprecated
anyhow, and not set anymore by default. So I guess it's safe
to remove the special handling here.

Change-Id: I2e8ff85350ba651d9a763aabba7b6494ba88d82e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-09 07:00:18 +00:00
Kai Koehne
0adb78a847 QElapsedTimer: Remove unused static nanosecondsToTicks method
Fixes clang-cl warning
 qelapsedtimer_win.cpp(80,22): warning: unused function 'nanosecondsToTicks' [-Wunused-function]

Change-Id: I1ff334049fcf4b265fe97235b7daf06969331313
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-09 07:00:11 +00:00
Kai Koehne
e251f11849 printsupport: Fix clang-cl warning
qprintengine_win.cpp(1117,14): warning: comparison of two values with different enumeration types in switch statement ('QPrint::DuplexMode' and 'QPrinter::DuplexMode') [-Wenum-compare-switch]
        case QPrinter::DuplexShortSide:

Change-Id: Ib5028d80ecf7f6bb9eb0562e5c137acfeb709a14
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-04-09 07:00:02 +00:00
Samuel Gaist
ffc71a977f QBenchmarkValgrindUtils: port to QRegularExpression
This patch updates the code from the deprecated QRegExp class to
QRegularExpression.

Task-number: QTBUG-25485
Change-Id: I946790f50c6b14787bca31771de5e3a0d5fefe4c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-09 06:57:46 +00:00
Eskil Abrahamsen Blomfeldt
9d1905da9c Revert "Fix font matching of typographic families on Windows"
This reverts commit bcd2fa484a.

There was a report that this caused infinite recursion on some
systems, so we revert it for now and re-add it later when the
issue has been resolved.

Task-number: QTBUG-74983
Change-Id: I747e0437232d72d7a87eb602b10fa09c7130ce8f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-04-09 06:02:22 +00:00
Paul Lemire
d92f63122b QShaderGenerator: stop abusing from auto everywhere
Leads to a huge loss of context for people trying to understand
and maintain that code. Replacing with proper types to ensure
better readability and maintenance.

Change-Id: I9900b743e8b7fe11bcc7db9ce3191c89f8718afc
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-04-09 04:46:20 +00:00
Timur Pocheptsov
4b445481c3 tst_http2 - extend 'singleRequest' test case
to test different h2 modes: "h2c" (clear text with protocol upgrade),
"h2" (encrypted, negotiating via ALPN extension), "h2-direct" (encrypted,
no ALPN), "h2c-direct" (plain text, no protocol upgrade). This patch-set
is  an amendment to the recent fix in the protocol handler where we were
crashing in "h2c-direct" mode.

Change-Id: I3ff5ed1396a59b72b59a95f927d404ccd202d0b8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-04-09 04:08:01 +00:00
Qt Forward Merge Bot
93acb76222 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I05d14a40e17554691bad369d0363e88413afd9b3
2019-04-09 01:00:06 +02:00
Allan Sandfeld Jensen
28c9e0e606 Remove handling of missing Q_COMPILER_RVALUE_REFS
Change-Id: I7bc6c455fbae4cdad584c76773299a6d8cd40c82
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-08 21:24:26 +00:00
Allan Sandfeld Jensen
8374b4016e Be more precise in calculating start point of fast scaling
We were using low precision dx/dy for calculating the starting point which
meant we could be off when clipping at high scale factors.

Fixes: QTBUG-60782
Change-Id: I883f9aed1346fdffae070b6316ea808b83519701
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-04-08 21:24:14 +00:00
Thiago Macieira
c2a1360b3f Update TinyCBOR with bugfixes
Updated to https://github.com/thiagomacieira/tinycbor commit
ac9369d8ec8511bc7516266ae6b07f7da860c954.

Fabrice Fontaine (1):
      fix undefined encode_half in json2cbor

Pedro Oliveira (1):
      Fixed minor error in the example code.

Svyatoslav Phirsov (2):
      Typo fixed in stdlib fread(...) usage
      typo in dumprecursive return type

Thiago Macieira (9):
      Install the tinycbor-version.h header.
      Update version number for a possible but unlikely 0.5.3 release
      Fix #137: off-by-one error in UTF-8 decoding
      Update Travis CI to Ubuntu Xenial
      Pretty: fix use of uninitialised variable
      Validation: fix out-of-bounds access when content ends in a string
      Parser: apply the same memory-check update
      Tests: remove useless comment
      Tests: Catch an earlier QCOMPARE failure in compare()

phirsov (6):
      Fix off-by-one causing buffer overflow in open_memstream
      Protect macro argument expansion using parentheses
      eliminating misleading messages in case .config file not yet created
      Run check silently in Travis
      Make AppVeyor test suit run silent as in Travis
      enhancement #149 implemented: access half-precision floating point data as single float

Change-Id: I9e3d261ad9bf41cfb2b6fffd159088f1cc9b3b02
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-04-08 20:12:35 +00:00
Friedemann Kleint
f7949df243 tst_QUrl: Fix left-over temporary directory on Windows
The test changes the current directory to the test directory
in fromUserInputWithCwd(), but did not restore it, causing:

Totals 898 passed, 0 failed, 1 skipped, 0 blacklisted, 368ms
********* Finished testing of tst_QUrl *********
QTemporaryDir Unable to remove "C:\\TEMP\\tst_qurl-ryVxqu" most likely due to the presence of read-only files.

Restore the old directory at the end to fix this.

Change-Id: I62669868f3c6d97dd38ebac76515428c14b7e1e7
Reviewed-by: David Faure <david.faure@kdab.com>
2019-04-08 18:44:25 +00:00
Friedemann Kleint
3a34ef636a QMenu/QComboBox: Extract helper for determining the pop up geometry
Move the code returning whether a popup should use the full
screen to QStylePrivate and use for QMenu and QComboBox.

Task-number: QTBUG-73231
Change-Id: I1901ecedfa90edf16329ce3b13ef4abea5ab44e8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-04-08 18:44:59 +00:00
Friedemann Kleint
8045ccc382 Windows QPA/File dialog: Pass up http[s] URLs
The native Windows allows for typing in http[s] URLs directly (without
checking existence). Pass these up.

Fixes: QTBUG-71785
Change-Id: I60237bab596ca3f52e6f513f17544ff94e9080da
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-04-08 18:44:42 +00:00
Friedemann Kleint
be56db2c49 uic: Fix enum values for Python
Add a helper for replacing "::" by "." for Python.

Task-number: PYSIDE-797
Change-Id: I017d430b0b8b2ffbbd3300d583603924fee4d479
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-08 18:43:33 +00:00
Friedemann Kleint
d54de865a4 uic: Port method calls to python
Use the language helper for dereferencing pointers and end of line.

Task-number: PYSIDE-797
Change-Id: Icbca9015f2a3e8800ad4a56edf8fef9ee43f4528
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-08 18:43:24 +00:00
Friedemann Kleint
6accc102d3 QStyle/QWidget: Avoid repetitive invocation of QStyleHelper::dpiScaled()
Store the result of QStyleHelper::dpiScaled() or functions dependent on it
in a variable, preparing the addition of a DPI parameter.

Task-number: QTBUG-45055
Change-Id: Ic70d65b590793c29a4b1f7a7a5312dd169517fc5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-04-08 18:42:30 +00:00
Joerg Bornemann
448177d857 Let "qmake -install qinstall" set default permissions 0644 and 0755
...like the install commands before Qt 5.9 did.
This ensures consistent permissions. Also, we can throw away the code
that took care of removing and re-adding the read-only flag on Windows.

This reverts commit a0b5d6e60f with the
addition of preserving permissions when copying directories to properly
install app bundles (QTBUG-74912).

Fixes: QTBUG-74733
Task-number: QTBUG-74912
Change-Id: Iee6d7c5e86787dd3ada5e5e9441209d418100b1f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-08 18:39:39 +00:00
Andre Hartmann
a02a2a1e73 QUdpSocket: Convert snippet to functor connect
Change-Id: Ice210b979a1dd948cd8d95003bd50a4b71d91852
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-08 17:00:13 +00:00
Andre Hartmann
6863262ded QUdpSocket: Add missing \since to docs
QNetworkDatagram was introduced together with
these methods in Qt 5.8 (commit 4da2dda2aa)

Change-Id: I454c26ebf6f94988cada8ac9315db1d43a31a595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-08 17:00:05 +00:00
Alexandru Croitor
4f07e711c9 Add script to print out list of unconverted .pro files
Also prints some statistics.

Change-Id: Ieb55618c0d39604ca76d7a44390e61e02824a01f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-08 14:53:46 +00:00
Alexandru Croitor
f896a5019a Stop installing test helpers
Tests and their helpers should only be used in the build directory.

Change-Id: I5aa9fcf734b6b3667f91df7c84d083f944c452c9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-08 14:53:35 +00:00
Alexandru Croitor
e0b4144486 Force feature_summary to fail when a required package is not found
Apparently calling set_package_properties with TYPE REQUIRED and
then calling feature_summary with FATAL_ON_MISSING_REQUIRED_PACKAGES
and PACKAGES_NOT_FOUND is not enough to make CMake fail when not
finding a required package.

You have to explicitly set REQUIRED_PACKAGES_NOT_FOUND to force
feature_summary to fail when a package is not found.

Do this, and also explicitly add the rest of the NOT FOUND cases,
to get a slightly clearer overview what kind of packages were not
found.

Task-number: QTBUG-74133
Change-Id: Id21af13dafafe0a458cff479e8abbc6aa7e6a3f7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-08 14:53:24 +00:00
Alexandru Croitor
5691d2f47b Fix yocto cross build
When cross-compiling Qt using a Yocto sysroot, if the sysroot
already contains an installed Qt version, and a project (library
or executable) does not explicitly link against all of its
Qt dependencies, the cross linker will try to find a suitable library
in the sysroot ./lib folder.

This mighy lead to issues, because the linker will pick up an
installed Qt library which might have different symbol versioning,
and thus cause linker errors.

This happened with the print support module.
Make sure the print support module explicitly links against the newly
built Qt modules.

Task-number: QTBUG-74133
Change-Id: I876b1507c655673831e78dcfe737a5ede2a8c087
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-08 12:41:42 +00:00
Qt Forward Merge Bot
01a269593d Merge remote-tracking branch 'origin/5.12.3' into 5.12
Change-Id: Id60d508c0f25fd5e67be07daafd2d4c56ae73934
2019-04-08 09:53:39 +02:00
Milian Wolff
58b4e07369 Optimize QTimer::singleShot(0, ...) when taking PMF or Functor callable
QTimer::singleShot is optimized for zero timeouts when using the API
taking a string method name. This optimization was not used for the API
taking a PMF or functor. This patch adds it, making the various API
calls behave similarly from a performance point of view.

The approach taken here requires a QObject context object. If none is
available, e.g. a nullptr was passed explicitly, or the
QTimer::singleShot(O, Functor) API was used, the optimization could
not easily be applied. This is not only bad from a performance POV,
but also poses as a potential source for heisenbugs: Using the
different API versions of QTimer::singleShot would use different code
paths internally, which then would not ensure the expected slot call
order. This problem actually existed already when mixing the
string-based slot syntax with PMF/functors in the QTimer::singleShot
API.

This patch overcomes this hurdle and fixes all of the above: When we
encounter a 0ms single shot timer, and no QObject context object is
available, we fall back to the main thread, or create a temporary
QObject for any other thread. The updated and extended benchmark
shows that this is still a significant performance improvement
over using a timer:

********* Start testing of qtimer_vs_qmetaobject *********
Config: Using QtTest library 5.14.0, Qt 5.14.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.1 20181127)
PASS   : qtimer_vs_qmetaobject::initTestCase()
PASS   : qtimer_vs_qmetaobject::bench(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot":
     7.48 msecs per iteration (total: 748, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf":
     7.20 msecs per iteration (total: 720, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor":
     6.79 msecs per iteration (total: 679, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx":
     6.92 msecs per iteration (total: 693, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string":
     7.34 msecs per iteration (total: 735, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf":
     6.90 msecs per iteration (total: 690, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor":
     6.62 msecs per iteration (total: 662, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_slot":
     7.45 msecs per iteration (total: 745, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_pmf":
     7.46 msecs per iteration (total: 747, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor":
     6.70 msecs per iteration (total: 671, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor_noctx":
     13.75 msecs per iteration (total: 1,376, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_string":
     7.05 msecs per iteration (total: 706, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_pmf":
     6.70 msecs per iteration (total: 670, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_functor":
     6.58 msecs per iteration (total: 658, iterations: 100)
PASS   : qtimer_vs_qmetaobject::cleanupTestCase()
Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 20977ms
********* Finished testing of qtimer_vs_qmetaobject *********

Without the change to qtimer.cpp, the results are:

********* Start testing of qtimer_vs_qmetaobject *********
Config: Using QtTest library 5.14.0, Qt 5.14.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.1 20181127)
PASS   : qtimer_vs_qmetaobject::initTestCase()
PASS   : qtimer_vs_qmetaobject::bench(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot":
     7.45 msecs per iteration (total: 745, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf":
     112.84 msecs per iteration (total: 11,285, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor":
     115.62 msecs per iteration (total: 11,563, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx":
     110.81 msecs per iteration (total: 11,082, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string":
     7.04 msecs per iteration (total: 704, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf":
     6.62 msecs per iteration (total: 662, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor":
     6.62 msecs per iteration (total: 662, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_slot":
     7.45 msecs per iteration (total: 746, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_pmf":
     118.42 msecs per iteration (total: 11,842, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor":
     119.35 msecs per iteration (total: 11,936, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor_noctx":
     130.96 msecs per iteration (total: 13,096, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_string":
     8.08 msecs per iteration (total: 808, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_pmf":
     6.79 msecs per iteration (total: 680, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_functor":
     7.49 msecs per iteration (total: 749, iterations: 100)
PASS   : qtimer_vs_qmetaobject::cleanupTestCase()
Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 153995ms
********* Finished testing of qtimer_vs_qmetaobject *********

Additionally, this patch adds a unit test to verify that the slot call
order for 0ms single shot timers is followed while mixing the various
API versions. It fails without this patch but passes now.

Finally, another test is added to verify that using QTimer::singleShot
before a QCoreApplication was constructed is still working properly.

Change-Id: I0d6211554b6198cb3e527be9ec3adc572b1b54ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 21:16:56 +00:00
Samuel Gaist
946d868619 QEasyingCurve: fix data stream operators
Until now, QEasingCurve was not streaming all it's internal state.
Therefore, doing store/reload operation through QDataStream would not
yield the same curve as the original. This patch fixes it.

[ChangeLog][QtCore][QEasingCurve] QEasingCurve now properly streams all
the data needed to QDataStream.

Change-Id: I1619501f5b4237983c8c68e148745a5e58863f55
Fixes: QTBUG-68181
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-04-06 21:12:40 +00:00
Davide Beatrici
e199710d0e QHostInfo: use dlsym() with RTLD_DEFAULT in case libs cannot be loaded
The current code only tries to load the required functions from
LIBRESOLV_SO (if defined) and resolv, but on FreeBSD they are in libc:
https://www.freebsd.org/cgi/man.cgi?query=res_query&sektion=3&apropos=0&manpath=freebsd

This commit changes the code so that, after failing to load the
non-existent libraries, it attempts to load the functions with dlsym()
using the special handle RTLD_DEFAULT, which searches for the specified
symbol in the loaded libraries.

This is a follow-up to 8eeb5150ed.

Change-Id: I19d90b0ca8703398bf4f5f4edd5ae31e346ef251
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 17:30:27 +00:00