Commit Graph

29488 Commits

Author SHA1 Message Date
Jake Petroules
4eb2feb29c Remove the ability to build simulator/device targets from SUBDIRS projects
This is done because a followup patch will cause simulator_and_device builds
to no longer use exclusive builds and so this feature could not work,
but it is not strictly necessary anyways because users do not need to be
able to do this.

Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: If869fbfea776751553c352c2d652edf745a3638d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-03 09:47:49 +00:00
Marc Mutz
7f801ed73a tuiotouch: clean up
- order includes from most specific to most general
- include only what you need
- port uses of inefficient QLists to QVector
  (required adding default ctors to the payload types)
- mark types as Q_MOVABLE_TYPE
- inline some trivial functions
- add explicit to ctors
- mark plugin with QT_NO_FOREACH

Change-Id: I7ae13141ece22bfdf49be42deb0987d51da2d72b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-09-03 05:07:28 +00:00
Friedemann Kleint
7fb3448161 configure.pri: Determine MSVC compiler version
Run cl.exe /? and extract version from header line printed
to standard error.

Change-Id: Iecf18f1b0f94cc1d51add7021d80772784e0f953
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-02 15:06:11 +00:00
Marc Mutz
ed9f8a0e9d bearer plugins: eradicate Java-style iterators and Q_FOREACH
This is the simple part of the job, removing Q_FOREACH loops
which are obviously safe to be replaced by C++11 range-for.

In QNetworkManagerEngine::sessionStateForId(), instead of
iterating over QHash::keys(), iterate over the QHash
directly (using C++11 range-for, as we're only using the
values, not the keys).

In QNetworkManagerEngine::connectToId(), simplify the loop
body by merging three identical if blocks into one.

Saves ~1.7KiB accumulated over the three Linux bearer plugins:
connman, generic, nm (optimized GCC 6.1 Linux AMD64 build).

Change-Id: Ic66139c25f7e2173f5a919927e269b873334d2c8
Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
2016-09-02 12:46:41 +00:00
Jake Petroules
73331eebf8 Enable precompiled headers on iOS, tvOS, watchOS
The actual blocker for precompiled headers is not the iOS/tvOS/watchOS
platforms, but the way qmake handled multiple-architecture builds on
Apple platforms.

This patch allows multi-arch builds to be performed while using
precompiled headers.

Since df91ef3d6c55692a0236f67b6c6b134a3bf84098 (April 2009), Clang has
had support for PCH files in the driver, which allows to use the
-include flag to automatically translate to -include-pch. We can then
take advantage of the fact that the -include option is allowed to not
be separate from its argument, which lets us take advantage of -Xarch to
specify a per-architecture precompiled header file.

This is done through some magic in the qmake Makefile generator which
"multiplexes" the PCH creation rule across multiple architectures and
replaces a series of tokens with the proper precompiled header paths
and architecture flags at usage point.

Change-Id: I76c8dc9cda7e218869c2919f023d9b04f311c6fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-02 08:25:31 +00:00
Maurice Kalinowski
443240b512 Fix output location for generated files
Not all tests have been updated to consider sandboxed targets causing
open/write errors.

Change-Id: Id7bb925c0faf04bf88cb126fb7c2846c38f36290
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-09-02 04:58:53 +00:00
Marc Mutz
bb7e3e2dd7 QTest: allow to mark QFETCH variables const
[ChangeLog][QtTest] QFETCH variables can now be declared const (QFETCH(const T, name)).

Change-Id: I7cc1e4568d7082f27f90d8b5abf53ffafb1c48c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-01 04:41:46 +00:00
Marc Mutz
6e64008e69 QColor: move contents of qcolor_p.cpp into qcolor.cpp
The functions defined there are used almost exclusively in
qcolor.cpp, so give the compiler the whole picture.

Also fixes the non-standard naming of the files: qcolor_p.h
should have been qcolor_p_p.h, since it declared functions
defined in qcolor_p.cpp.

Change-Id: I06e61232a906fd0d98d5adcfe4af5881985367d8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-01 04:40:50 +00:00
Thiago Macieira
8cfac7fba6 configure: ask pkg-config only for the info we're interested
No need to get libs flags other than -L and -l, since we're adding
everything to the LIBS variable in qmake anyway. We wouldn't want rpath
or other linker flags to leak through.

Change-Id: I7d42fe4b581e49df891cfffd146fab61fecbc5c9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-31 19:22:34 +00:00
Gabriel de Dietrich
b09e0636f8 QNetworkProxy: Remove calls to deprecated API on macOS
CFURLCreateDataAndPropertiesFromResource has been
deprecated since 10.9.

Instead of loading the PAC file contents, we call
CFNetworkExecuteProxyAutoConfigurationURL. This
function being asynchronous, we make sure we block
until the CFProxyAutoConfigurationResultCallback
has been invoked.

Change-Id: I97e32d7f9b349e8e15fe1fdcb35b10e7aab39b3a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-31 14:33:16 +00:00
Maurice Kalinowski
982f17e961 Make test work for sandboxed targets
While testdata has been added in a previous commit, the test never
searched for files and directories properly.

Change-Id: Ieae28e5f7e4ef8968b13f5ede553bd5268e53e17
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-31 10:00:39 +00:00
Maurice Kalinowski
a62015e3a2 winrt: Update search location for testdata
Change-Id: I5fd9001eec90c6054c0429506d75640ecf104ae5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-31 10:00:35 +00:00
Maurice Kalinowski
0127f0fa6b update testdata
Change-Id: I7bc5c58e73a5b31ef3a5ee6eff62212d0c18e416
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-31 10:00:29 +00:00
Thiago Macieira
84830fc07d QLockFile::tryLock: prevent over-sleeping in certain cases
The sleep time increases exponentially, but we never checked whether the
time to sleep was less than the remaining time. For example, if timeout
was 4000 ms on entry, we'd progressively sleep 100 ms, 200, 400, 800,
1600 ms. At this point, the accummulated sleep time would be 3100 ms and
the next sleep should be no more than 900 ms.

Prior to this change, the tryLock() would then proceed to sleep 3200 ms,
for a total wait time of 6300 ms, or 57.5% above the timeout provided by
the user.

Change-Id: Ifc295639c8cf4ddcaa69fffd146f7586a7ee95e4
Reviewed-by: David Faure <david.faure@kdab.com>
2016-08-30 21:52:04 +00:00
Thiago Macieira
eebdb16c63 QLockFile: Use QDeadlineTimer in tryLock
This simplifies the code a bit.

Change-Id: Ifc295639c8cf4ddcaa69fffd146f7535d646cb15
Reviewed-by: David Faure <david.faure@kdab.com>
2016-08-30 21:51:55 +00:00
Thiago Macieira
1a09c599b3 QDeadlineTimer: inline the isForever function
The constructor that sets it is inline already, so there's no point in
hiding this.

Change-Id: I66707fdfe8eb460a9c72fffd146d8dbc35b13056
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-08-30 18:41:29 +00:00
Oswald Buddenhagen
1d0d5aaeb5 uic: prune unused includes
incidentally, this helps with building in feature-reduced
configurations.

Change-Id: I2f523cff92985539383970e137df12d86c20a626
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-08-30 18:35:18 +00:00
Mike Krus
c3f59f22ee Move ios_devices.pl into uikit folder
Was left behind in previous merges

Change-Id: Ic30cc2b234b904ad819c4e3e57804ac6e58ec1e9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-30 18:14:32 +00:00
Oswald Buddenhagen
57d4b8f328 de-duplicate code relating to evaluation of 'negative' flags
Change-Id: I3fe4816719d9b2885319a1bb516cfb137f13e3f8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-30 13:24:20 +00:00
Oswald Buddenhagen
793f4ae5c9 remove pointless export from qtConfHandleLibrary()
that variable is not modified in this scope, so there is no point in
exporting it here. it was probably a leftover from an earlier version.

amends c0cc50520.

Change-Id: Ic6f93d8c38d547308aa88ef337fe49bda004b337
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-30 13:24:17 +00:00
Oswald Buddenhagen
03247666ee make qtConfOutputVar() a tad less cryptic
don't use variables where the value is known.

Change-Id: I3ec21441c5b7ee0b028f8f72e05d9e40e6192ecf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-30 13:24:11 +00:00
Oswald Buddenhagen
7e97d360a3 don't export cached libraries which were in fact not found
amends ce7df6ac7d.

Change-Id: I9898e756283a2e2556458bf71b59b0c1c76064ec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-30 13:24:07 +00:00
Oswald Buddenhagen
85f2bdea44 unbreak pkg-config use with cache
test callbacks MUST NOT act as outputs, ever.

this went unnoticed so far, as it would become visible only with
configure -recheck.

Change-Id: Idd923097b4b2790ef4fe8a6d430db4b62851801a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-30 13:24:02 +00:00
Oswald Buddenhagen
95eed6278a fix location of injected headers in shadow builds
they are build-time generated, so they must go to the build dir
irrespective of whether we're using pre-synced headers.

Task-number: QTBUG-55585
Change-Id: I5f10b35c40b0ae2ddc5568d70e254b787ac3f914
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-30 13:23:27 +00:00
Marc Mutz
eb1f6c63a5 uic: use QStringList::removeDuplicates()
... instead of rolling our own version.

Change-Id: Ibd29f233844a6283349d086c4fbc88d7e1087653
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-08-30 12:58:39 +00:00
Oswald Buddenhagen
f43a258fc4 fix build with configure -sdk iphonesimulator
we need to suppress another qtConfig(simulator_and_device) check during
the configuration phase.

amends 60985aa4.

Change-Id: Iae279d282d47b4c254b7a6f9f33315abe126eff0
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-30 12:55:57 +00:00
Allan Sandfeld Jensen
7037539f38 Optimize the simple QImage flip used by OpenGL
The vertical mirror is simple enough it can be done by memcpy most of
the time, and is commonly used when bridging raster and OpenGL.

This patch adds a simple optimized function for QImage flipping.

Change-Id: I83a0192fc150576dcf573895cdaecb17b0ed72a5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-30 08:43:26 +00:00
Gabriel de Dietrich
bc1b45ff9f QSettings: Remove calls to deprecated API on macOS
CFURLCreateDataAndPropertiesFromResource and
CFURLWriteDataAndPropertiestoResource have been
deprecated since 10.9. We replace them with simple
QFile access.

Code cleaning and included.

Change-Id: I19c7ceac41c8c511962f1128bd8e210e3adb434c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-30 01:52:53 +00:00
Friedemann Kleint
4c1c68b2ba QtPlatformSupport: Restrict usage of DBus for menu/tray icons to Unix
Otherwise, there is a needless dependency on DBus on Windows.

Change-Id: I6ef9ec41a74c2f864dddf78abede205493eae5b3
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-29 22:44:55 +00:00
Laszlo Agocs
547d3f0ebe Fix bundled xkbcommon build without xcb-xkb present
The condition went missing in the process of cleaning up.

Change-Id: If4f7958e5e5983c86f86a009aaa88d1f5e7ec76d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-29 22:44:35 +00:00
Liang Qi
1cc571593a Merge remote-tracking branch 'origin/5.7' into 5.8
cf53aa21bf and 3aaa5d6b32
were reverted because of reconstruction in 5.7.

defineTest(qtConfTest_checkCompiler) in configure.pri is smart
enough to cover the case in a9474d1260.

DirectWrite: Fix advances being scaled to 0

Since 131eee5cd, the stretch of a font can be 0, meaning
"whatever the font provides". In combination with ec7fee96,
this would cause advances in the DirectWrite engine to be scaled to
0, causing the QRawFont test to fail.

Conflicts:
	configure
	mkspecs/features/uikit/device_destinations.sh
	mkspecs/features/uikit/xcodebuild.mk
	src/corelib/global/qglobal.cpp
	src/corelib/global/qnamespace.qdoc
	src/plugins/platforms/cocoa/qcocoamenuitem.h
	src/plugins/platforms/windows/qwindowsservices.cpp
	src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
	src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
	src/widgets/kernel/qapplication.cpp
	tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
	tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp

Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
2016-08-29 15:30:17 +02:00
Liang Qi
cc74452d6d Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	configure
	src/plugins/platforms/winrt/qwinrtclipboard.cpp

Change-Id: Ic6d58be3d1ed2bb507f2ba06c82361afd9f9ddb9
2016-08-29 08:13:40 +02:00
Samuel Gaist
e52fcb7dc7 QTextDocument: fix string backward search
[ChangeLog][QtGui][QTextDocument] Fixed a bug that would return a wrong
position when searching backward from the end of the document.

Task-number: QTBUG-48182
Change-Id: I6e88f808a50cb840f61e7bc579e2a28c5300089d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-28 15:18:55 +00:00
Thiago Macieira
2743cd54a0 Mark Clang 3.9 as warning-free
Change-Id: Id75834dab9ed466e94c7ffff1444b71f29f49afd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-27 19:05:08 +00:00
Marc Mutz
829c59aa4a linuxfb plugin: eradicate Q_FOREACH loops
... by replacing them with C++11 range-for loops.

Then mark the plugin as QT_NO_FOREACH.

Change-Id: I80a18334b1e0c5bbd44dfe45eea80591d478a8d6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-27 05:09:35 +00:00
Marc Mutz
dd0daa73f5 tests/auto/corelib/json: clean up
Just one Q_FOREACH needed porting to C++11 range-for here.

Change-Id: I30ddd2a80cbb3245e23accc7843e67574fb2db17
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-27 05:09:29 +00:00
Marc Mutz
33aaa6a995 minimal platform plugin: eradicate Q_FOREACH loops
... by replacing them with C++11 range-for loops.

Change-Id: I0798d02e19d9f53d96db2f14554325eaeff2a26d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-27 05:09:25 +00:00
Marc Mutz
3c7d67a044 offscreen plugin: eradicate Q_FOREACH loops
... by replacing them with C++11 for-each loops.

In clearHash(), replace iteration over QHash::keys() with
iteration over the hash itself. Also use the new const-
iterator overload of QHash::erase() to save one attempted
detach (in QHash::find()).

Mark the plugin as QT_NO_FOREACH.

Saves almost 2KiB (1.4%) in text size on optimized GCC 6.1 Linux
AMD64 builds.

Change-Id: I9bb3154130687c0061ea09b04ab5f627a4d2296c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-27 05:09:20 +00:00
Marc Mutz
efcae5d5ca tests/auto/corelib/xml: cleanup
- port Q_FOREACH to C++11 range-for
- mark types held in Qt containers as shared
- port inefficient QLists to QVectors
  (required adding an artificial default ctor to one of the payload types)
- fix algorithmic mistake:
  * don't use a QMap to sort a vector of QXmlStream{Attribute,NotationDeclaration},
    constructing a QString key from the QStringRef name(). Use std::sort with a
    lambda. Since this code is used in two places, and we don't yet require poly-
    morphic lambdas, factor the code into a helper function template that also
    takes care of adding the const to the return type so the range-for doesn't
    detach the container.

Fixes errors reported by my local tree's static checks.

Change-Id: I3de97d9b03c87455aa6030998e9ca26c6c79a2e3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-27 05:09:16 +00:00
Marc Mutz
1f8d61954d tests/auto/corelib/plugin: clean up
- port from Q_FOREACH to C++11 range-for

Fixes errors reported by my local tree's static checks.

Change-Id: Ib8522ed424ba227d84f9664c3282f95f6bee547c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-27 05:09:07 +00:00
Marc Mutz
634708724b mark some already-clean platform plugins as Q_FOREACH-free
Change-Id: I6ef2bb7caf2cf624e7832936202e546298ee9256
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-26 22:23:50 +00:00
Thorbjørn Lindeijer
d7d8cde4bb QColorDialog::getRgba: Fixed ignoring of initial alpha value
The documentation for this method explicitly states that the initial
color+alpha is used, but its implementation used a QColor constructor
that ignores the alpha value.

Change-Id: I71721386e7fae0761e079d8840ec0124a8c14e33
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2016-08-26 22:18:02 +00:00
Oswald Buddenhagen
dbeca395b8 make 'angle' a public feature
the public win32/opengl.prf references it, so it must be public as well.

Change-Id: I95f6571bd3cdb7d35b2182bebf663e50140e065e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-26 14:28:05 +00:00
Oswald Buddenhagen
85a36111bb don't rely on configure.exe being in source packages any more
now that configure.bat takes care of printing the help screen itself,
there is no compelling reason to ship configure.exe in the source
packages any more. consequently, always bootstrap it.

Change-Id: I5bf0946549e3c426c1a4a94b1c22f6c0f4b4993c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-26 14:22:51 +00:00
Anton Kudryavtsev
d2f6f66a03 QIconCacheGtkReader: use QStringRef more
lookup() method now takes QStringRef arg.
Reduce allocations.

Change-Id: I556d01be5c5f268672121ab4c67c652cb6cfe090
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-26 12:21:46 +00:00
Nico Vertriest
6cbd982836 Revert "Doc: removed reference to non-existing method"
This reverts commit 53f0b43a4b.
{QAbstractAnimation::}{updateCurrentValue()} had been modified to
{QVariantAnimation::}{updateCurrentValue()} in a previous patch.

Change-Id: Ibaccf51de816966f16b8f3109e0c20626d5102a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-26 11:40:11 +00:00
Tor Arne Vestbø
6621e6f89a Make QSurfaceFormat a Q_GADGET and add Q_ENUM for easier debugging
Change-Id: I2fa0bc13bd90da53858ba3e0c6351f545e792fde
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-26 11:31:21 +00:00
Marc Mutz
c47d1d74a7 platformsupport: eradicate some easy Q_FOREACH loops
All loops trivially not modifying the iterated-over
container.

Saves ~9.4KiB in text size across all plugins and libs
(statically) linking in QtPlatformSupport (optimized
GCC 6.1 Linux AMD 64 build).

Change-Id: I2d91da1f78d9b33d4c5e4a1627560d8e705a9b9a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-26 10:42:37 +00:00
Marc Mutz
919978afae dbusmenu: eradicate Q_FOREACH loops
... by replacing them with C++11 range-for loops.

Saves ~1.7KiB in text size across all plugins and libs
(statically) linking in QtPlatformSupport (optimized
GCC 6.1 Linux AMD 64 build).

Change-Id: I492bf2d6afe9bccdc1237003388fcb83a2261dba
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-26 10:42:27 +00:00
Marc Mutz
d875a04174 QtJson: simplify/add missing relational operators involving Latin1String
As noted by Mat Sutcliffe <oktal3700@gmail.com>, there were
no relational operators for Latin1String/QLatin1String and
String/QLatin1String mixed comparisons, leading to implicit
conversions from QL1S to QString in Entry::op==(QL1S).

This patch fixes half of the issue, by providing the operators
for Latin1String/QLatin1String. In doing so, it cleans up their
definition (non-members, non-friends, delegating to existing
QL1S operators where possible, passing both {Q,}Latin1String by
value, as they're both Trivially Copyable and small).

A follow-up patch will deal with String/QLatin1String
comparisons. It will be not quite as straight-forward as
this patch, since we don't, yet, have QStringView, the
UTF-16 equivalent of QL1S, available.

Amends a5159cc50a.

Change-Id: I596358eb3ccf847b7680f171f9992f3fad80132c
Reviewed-by: Mat Sutcliffe <oktal3700@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-26 08:25:31 +00:00