Commit Graph

39899 Commits

Author SHA1 Message Date
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
Allan Sandfeld Jensen
5c90a96998 Remove handling of missing Q_COMPILER_CLASS_ENUM
Change-Id: I1fd6d601e49e803b4c3308fb0ca41136c628afbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 16:19:14 +00:00
Allan Sandfeld Jensen
4628e5cded Remove handling of missing very old compiler feature check
Removes handling of missing Q_COMPILER_NULLPTR, Q_COMPILER_AUTODECL,
Q_COMPILER_LAMBDA, Q_COMPILER_VARIADIC_MACROS and
Q_COMPILER_AUTO_FUNCTION.

We haven't supported any compilers without these for a long time.

Change-Id: I3df88206516a25763e2c28b083733780f35a8764
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 13:27:15 +00:00
Allan Sandfeld Jensen
1ef274fb94 Replace qMove with std::move
Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-06 11:00:38 +00:00
Davide Beatrici
8eeb5150ed QDnsLookup: fix "Resolver functions not found" error on FreeBSD
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.

Task-number: QTBUG-74844
Change-Id: If97aaae233cabbfa01c30d26d9a7fb01ec3ff5c2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 01:29:31 +00:00
Qt Forward Merge Bot
980755bbcf Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev 2019-04-06 01:16:27 +00:00
Qt Forward Merge Bot
3460e6e941 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ib7c4fc52915b5e6c72b9aa262fb59f2a041dccd7
2019-04-06 01:00:46 +02:00
Qt Forward Merge Bot
ce7f14d2e0 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iec860bb703f983b7438e67c695b9c454e72b3e0f
2019-04-06 01:00:08 +02:00
Allan Sandfeld Jensen
dbf7706413 Replace Q_DECL_NOEXCEPT with noexcept in QtGui
Change-Id: I43803b88fea8083782d73ce157c466b022208740
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 22:26:49 +00:00
Edward Welbourne
82ad4be4a2 Fix various uncommon cases in QTzTimeZonePrivate backend
Includes a fixup for 03fadc26e7, which
removed the check on empty transition list, needed when no data are
available.  Ensured that such a data-free zone would in fact be
noticed as invalid during init().

Fixed handling of times before the epoch (we still want to consult a
POSIX rule, if that's all that's available) while ensuring we (as
documented) ignore DST for such times.

Fixed handling of large times (milliseconds since epoch outside int
range) when looking up POSIX rules.  Gave QTimeZonePrivate a YearRange
enum (to be moved to QTimeZone once this merges up to dev) so as to
eliminate a magic number (and avoid adding another).  Moved
year-munging in POSIX rules after the one early return, which doesn't
need the year range.

Added test-cases for the distant past/future (just checking UTC's
offsets; SLES has a minimal version of the UTC data-file that triggers
the bugs fixed here for them).

Fixes: QTBUG-74666
Fixes: QTBUG-74550
Change-Id: Ief7b7e55c62cf11064700934f404b2fc283614e1
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 20:31:26 +00:00
Albert Astals Cid
867956a843 cmake: Build qcommandlineparser/testhelper
Change-Id: I1042e85575b39df18bcaaff7b57acc15d8552e6d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-05 15:57:32 +00:00
Albert Astals Cid
067d5dc027 cmake: Run tests from their build dir
It's what the qmake build does

Change-Id: I99663735859941b56c2211898908d61bc6c4b48f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-05 15:57:20 +00:00
Paolo Dastoli
6b66108c1f Add serializer/deserializer for Enumeration
Enum class are serialized using the declared size.

[ChangeLog][QtCore][QDataStream] Enumerations can now
be serialized through QDataStream without the need of
manually defining streaming operators.

Change-Id: Iae9a63eb62b5a5615b657766a3c4c66ba4d98d0e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Paolo Dastoli <paolo.dastoli@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 14:54:25 +00:00
Milian Wolff
f4c41b9797 Add missing _exit tracepoints for event handling
This allows tools that look for matching `foo_entry/exit` pairs in the
trace data to work properly. An unmatched `_entry` would otherwise
confuse them, making them think that the call stack is continuously
increasing.

Change-Id: Idff7f587ea25c46ec86ad623cc82d503db34a194
Reviewed-by: Christoph Sterz <christoph.sterz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 11:57:59 +00:00
Milian Wolff
127518deda Introduce Q_TRACE_SCOPE to simplify tracing of a function entry/exit
Additionally, we also add a Q_TRACE_EXIT which runs a trace point when
the scope is exited, leveraging qScopeGuard behind the scenes.
Q_TRACE_SCOPE uses Q_TRACE_EXIT internally - the difference is that
the _SCOPE version enforces the naming scheme of _entry / _exit for the
tracepoints, whereas Q_TRACE_EXIT can be used generically.

Change-Id: I4a2f5ea09f451fcf664d07fd493b679f7527ac06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 11:57:52 +00:00
Milian Wolff
5f62202e6c Add tracepoint to qt_message_print
This allows us to deduce a lot about what a Qt application is doing,
since the debug output usually contains a lot of information.

Change-Id: I28a18afd151a1640a44ba8c7c9cd87d5d66c99b0
Reviewed-by: Christoph Sterz <christoph.sterz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 11:57:46 +00:00
Milian Wolff
6ce2a87c23 Forward declare all types required for compilation with -trace
This patch fixes compilation with `-trace lttng` or `-trace etw`. We
need to forward declare QEvent, QImageReader etc., otherwise the types
will be unknown while compiling the trace points.

In order to handle this generically, the tracegen utility is extended
to support a 'prefix text' in the `*.tracepoints` input files. Any
text within curly braces will be embedded as-is in the generated file.
This can then be used to add forward declarations for the types we
need, including potential namespaces and such.

Change-Id: I5cb16763ce0fcb48ce3ea4577578d468ff3a4f4b
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
2019-04-05 11:57:39 +00:00
Friedemann Kleint
df7eec6bcb Windows QPA/File dialog: Refactor code copying non-file shell items
Remove the canCopy() check which is not required and pass up the error
message. Remove special characters and use the base name of the display name
which can be an URL.

Task-number: QTBUG-71785
Change-Id: I22966cb8d1f5bca0bbca71cf3ebe66e4ede1a747
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2019-04-05 10:28:00 +00:00
Qt Forward Merge Bot
0998a9d1d5 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I010a6322d12e038fdce247a58dfb05e204c2ff3b
2019-04-05 10:57:24 +02:00
Albert Astals Cid
bdee1189bf png handler: initialize all the variables passed to png_get_IHDR
oss-fuzz found at least width is sometimes not initialized, and we're
initializing almost all of them in most cases so be complete.

the oss-fuzz instance was
==1==WARNING: MemorySanitizer: use-of-uninitialized-value
	    #0 0x667c43 in operator!= /src/qtbase/src/corelib/tools/qsize.h:173:25
	    #1 0x667c43 in setup_qt /src/qtbase/src/gui/image/qpnghandler.cpp:403

Change-Id: Idb9aaf5ab85509d9c893beaf8d9118339ba46be7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-04-05 08:53:01 +00:00
Friedemann Kleint
7ac2263f30 Windows code: Replace deprecated QVariant API
Task-number: QTBUG-74043
Change-Id: I6f5f47b74830597eec74e2582e24d2d7dd235a80
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-04-05 08:30:51 +00:00
Friedemann Kleint
5a5a96560e uic: Adapt connection syntax to Python
Extend WriteInitialization::findDeclaration() to return the class name
(on this occasion preparing for generating Qt 5 connection syntax) and
add a helper function for formatting the connection.

Task-number: PYSIDE-797
Change-Id: I7507f604c8275c93d347b7a6a5d5b5a2a5f3ffd5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-05 08:29:26 +00:00
Friedemann Kleint
5b8676578d uic: Add qualification with "self." for Python
Prepend "self." (this) to the name stored in the class Driver's hashes
as specifying it is mandatory in Python.

Task-number: PYSIDE-797
Change-Id: I1da110b84b2d1131ee6af915f9cc4ba21d7de710
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-05 08:29:19 +00:00
Friedemann Kleint
bc8633036c uic: Add python
- Add command line option
- Add import (include) handling
- Add language helpers like streamable classes for Function definition,
  object instantiation
- Implement header comment formatting

Task-number: PYSIDE-797
Change-Id: I15041ab16504ea159f6665781a829cd548585af1
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-05 08:29:11 +00:00