Commit Graph

29642 Commits

Author SHA1 Message Date
Jake Petroules
87ae0bc169 Remove macx-clang-32 and macx-g++-32 mkspecs
32-bit Qt for macOS is now deprecated.

Change-Id: Idda4f4b3d48c58afae3932e7802bcf82cc75d3aa
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-09-21 23:06:20 +00:00
Jake Petroules
8f06124b70 macOS: fix 32-bit builds
Change-Id: I767b8907f91fd45f662b67ba7b9a8378a3e4851e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-09-21 23:06:11 +00:00
Paolo Angelelli
a6b8b03f86 OpenGL: add support for compute shaders in GLES 3.1
OpenGL ES 3.1 introduces compute shaders. This patch enables them also
in QOpenGLShader/QOpenGLShaderProgram.
A GL/GLES example using QOpenGLShaderProgram for compute shaders is also
included.

Change-Id: I3951a302d7c2b096548f829b9b4578b5a525c453
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-09-21 16:45:50 +00:00
Liang Qi
abbc5ecc5e Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/dev 2016-09-21 16:47:42 +00:00
Jake Petroules
207694fbcb configure: look for Android SDK and NDK in standard locations
These locations are where the official Android Studio IDE places its
copies of the SDK and NDK.

Change-Id: I2ea765c66a6ca4d11c573054375b797bd3da9d82
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-09-21 15:45:25 +00:00
Serge Lysenko
6ac4410228 Fix Windows DnD: Alt key modificator was interpreted as mouse Xbutton
Qt4->Qt5 regression:
QWindowsMouseHandler::keyStateToMouseButtons() cannot be used instead
of the old Qt4 function toQtMouseButtons() because Alt key and mouse
Xbutton have the same code on the Windows.

Task-number: QTBUG-55885
Change-Id: Ibad35cfe83145d03fd05f397c0afba9c86817a0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-09-21 12:11:30 +00:00
Liang Qi
eaec2b664a Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/gui/painting/qcoregraphics.mm
	src/network/access/qnetworkrequest.h
	src/plugins/platforms/cocoa/qcocoahelpers.mm

Change-Id: I81266414c06ea2edf63cbc7e93a86bd5d66a31a5
2016-09-21 09:11:02 +02:00
Allan Sandfeld Jensen
31c251765d Save memcpy when converting to 32bit formats
If the destination format is 32bit, we can convert directly in the
destination instead of in a buffer.

Change-Id: I2b4407da77b863deec7869c341e1a8d464b46600
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-20 23:21:11 +00:00
Nico Vertriest
b69ac5a0af Doc: corrected mistaken refernce to macro \macos
Change-Id: I734943820400384a2f9ac7e148dc42d3428b0732
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-09-20 19:46:17 +00:00
Allan Sandfeld Jensen
b598541bf3 Simplify source fetch qdrawhelper tables
Collapse the tables that are mostly identical, to much shorter tables
and a simple functions to make it easier to read and maintain.

Change-Id: I44fdaebe9927b49a94385057756d9d87ad3c33f5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-20 14:26:16 +00:00
Alex Blasche
e395e79145 Fix QtNative.checkSelfPermission()
Only return activity object when available and *not* when unavailable.

Task-number: QTBUG-55035
Task-number: QTBUG-50759
Change-Id: I60b1be528b2e4a3d630f4085b7642d74e18482bd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-09-20 11:13:42 +00:00
Frederik Gladhorn
278e557cea Change a few c-style casts to static/reinterpret_cast
Change-Id: Id375415c036987cc11aa37c43d9fc2932f23ceb0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-09-20 07:33:35 +00:00
Frederik Gladhorn
e42d0d3caa Declare parameters to xcb_create_window with correct type
Change-Id: I76898ae971858f35557a50baa4a546cfad91ae14
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-09-20 07:33:27 +00:00
Jake Petroules
6616617a87 Replace usages of QSysInfo with QOperatingSystemVersion
Occurrences which should simply be removed entirely (due to always being
true or always being false as a result of the current OS support matrix)
have been left untouched for now.

Change-Id: I86d5a084cb84bc28fefc5191d40924de1439b3de
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-09-20 06:46:10 +00:00
Jake Petroules
8a48d66da9 Deprecate QSysInfo::MacVersion, QSysInfo::WindowsVersion, etc
QSysInfo::WinVersion, QSysInfo::WindowsVersion,
QSysInfo::windowsVersion(), QSysInfo::MacVersion,
QSysInfo::MacintoshVersion, and QSysInfo::macVersion() are now
deprecated.

QOperatingSystemVersion exists as a more flexible replacement.

Change-Id: Ib97d1bfb260f2595ba3c06ff8fd251c5de41cedc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-20 06:46:14 +00:00
Friedemann Kleint
6005d75c15 QIconPrivate: Pass QIconEngine as parameter to constructor
This removes the need to assign to the member variable
after constructing an instance.
Simplify code accordingly.

Change-Id: I9660f1ff2cb5a17b8eee697988bed03b76468112
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2016-09-20 06:37:08 +00:00
Jake Petroules
04cb6e2754 Fix namespaced build on iOS
Change-Id: I682fabe8891e0325e6545b4499a59af4ad584c41
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-20 05:46:56 +00:00
Erik Verbruggen
3982e710cb QTest: add debugger detection for macOS
Which, in Mach speak, is an exception handler for the process. Also
check if the crash reporter is in a mode that will show a dialog for
any crashed process. If so, leave it to that crash reporter to do stack
traces.

This patch has the nice side-effect that a crashing test won't have both
a debugger and CrashReporter generate stack traces.

You can check the settings for CrashReporter on macOS with the command:

    defaults read com.apple.CrashReporter DialogType

If it is set to 'basic' or 'developer' or 'crashreport', CrashReporter
will show the dialog. If set to 'server' it won't. Any unattended system
should have it set to 'server' (which will have QTest invoke lldb to
generate stack traces):

    defaults write com.apple.CrashReporter DialogType server

Change-Id: I39153e44cff15c00341857f178b1dcfab154f8ee
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 08:13:27 +00:00
Jake Petroules
42ac179631 Remove special case for Android in QSysInfo::productVersion
Incidentally, this means that the function will no longer include the
patch version number on Android, but this is more consistent with other
platforms like Apple and Windows anyways.

Change-Id: I9996317e73e491b3a139a511efe1384c57b73e0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 21:22:33 +00:00
Jake Petroules
55ac42dd13 Change QSysInfo::prettyProductName() to print the codename on Android
Change-Id: I967d57121c8e48c603842cd1024d9228cff19944
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 21:22:28 +00:00
Jake Petroules
26b2ad5a18 Long live QOperatingSystemVersion!
This class provides a "type safe" way to compare and access operating
system version numbers.

[ChangeLog][Deprecation Notice] QSysInfo::windowsVersion() and
QSysInfo::macVersion() are deprecated and are replaced by the newly
introduced QOperatingSystemVersion.

Change-Id: I52b532de2e068ccf90faaa8342eee90c0a4145de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 21:22:22 +00:00
Allan Sandfeld Jensen
8b2f91e328 Add AVX2 versions of the fast blending functions
This patch adds AVX2 versions of the fast blending functions that we
already have SSE2 versions of.

Change-Id: Ifd1a22f7891b6208cb74929ad26095d12c5a1efb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 19:36:30 +00:00
Tor Arne Vestbø
2d2d90781a macOS: Implement QCocoaBackingStore in terms of QRasterBackingStore
The previous detection of device pixel ratio changes in paintDevice()
is not needed, as QBackingStore::beginPaint() already does this check
and calls resize().

Change-Id: I9ee8410fa3a5404c5ec19d2cba4543a9e3359fe9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-09-18 14:33:04 +00:00
Morten Johan Sørvig
41ab34d9e8 Blacklist modalWindowModallity on macOS aka “osx”
Passes locally, unstable on CI.

Change-Id: I251ad9603d14fd6195f721135ac606a1fd6b5060
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-18 14:32:42 +00:00
Tor Arne Vestbø
dc3af6a164 iOS: Implement support for QScreen::grabWindow()
Only windows that are part of the application can be grabbed. This
excludes the system statusbar and other system overlays, as well
as windows of other applications. This is a limitation due to the
security model of iOS.

There exists APIs to grab a snapshot of the complete screen, but
these APIs return a view that can be used as a placeholder e.g.
during view transformations, and doesn't match our API that require
reading of pixels.

Task-number: QTBUG-49944
Change-Id: I8fd5b4c2777be1486f0ff22762d5e9b64c927e70
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-09-18 11:38:59 +00:00
Tor Arne Vestbø
5ad8b3aa32 macOS: Move QColor/QBrush conversion functions to QtGui
Change-Id: I971d1d69b491532fd0dc0bab72b274dec6591e6b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-09-18 11:38:54 +00:00
Tor Arne Vestbø
49b3510bb9 macOS: Move image conversion functions to QtGui
Change-Id: I911f2648e506f27519e98be1bffe2c5ab0f388f1
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-09-18 11:38:47 +00:00
Tor Arne Vestbø
e419403ebf macOS: Remove unused function qt_mac_QRegionToHIMutableShape
Code using it was removed in a198ce8d.

Change-Id: I841f55768da080fbc87e0f2d9394cdc0a22e500e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-09-18 11:38:41 +00:00
Marc Mutz
d58d7a5376 Add QStringList::join(QLatin1String) overload
Costs only ~300B in text size in QtCore, which is roughly compensated by
savings in other QtBase libraries, even without specifically porting
users to QL1S.

Of course, the raison d'être for this overload is avoiding the expensive
QLatin1String -> QString conversion which, for small lists, can take up
to 50% of the total runtime (assuming memory allocations dominate over
scanning and copying the list).

[ChangeLog][QtCore][QStringList] Added join(QLatin1String) overload.

Change-Id: I91d7e1d4e2c76d6dc79f2b750cf8e256dd4e0ab6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 07:28:56 +00:00
Tor Arne Vestbø
c52bb03090 macOS: Move QMacCGContext helper into QtGui
The implementation was duplicated and spread out between QMacStyle,
QMacPaintEngine, and the Cocoa platform plugin.

Moving it into QtGui allows using it on other Apple platform.

Change-Id: Iadcbd71998204887e116271c575037789b6e2163
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-17 18:00:47 +00:00
Marc Mutz
542ba86e22 tests/auto/corelib/mimetypes: use local QThreadPool
Isolates the test from anything that might be going on on the globalInstance().
Enabled by the explicit thread-pool feature on QtConcurrent::run().

Add explicit timed wait (unit tests should contain as little indefinite waits
as possible).

Also avoids the use of QFutureSynchronizer, which makes my static QList
checker go nuts, with no way of fixing it until Qt 6.

Change-Id: I0829992642b2a49bb6a10ddd4b31eb3f88e3adeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-17 06:47:05 +00:00
Marc Mutz
1b98ce1986 QSqlRelation: mark shared-come-qt6
... and plaster API with nothrow (well, one function).

Change-Id: I36fd64c6fda5390954c82bba307c720d3b3215df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-17 06:47:01 +00:00
Thiago Macieira
18ed6f20ad Change some #elif to #endif / #if in qcompilerdetection.h
The conditions aren't exclusive, but complementary.

This change removes one check for defined(Q_CC_INTEL) because it was
disabled before and requires testing before we confirm it to be correct.

Change-Id: I33dc971f005a4848bb8ffffd14748cde4dd23333
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-09-16 21:25:47 +00:00
Thiago Macieira
a6bc0157eb Correct the C++ standard references in QMutex functions
Section 30.4.1.3 [thread.timedmutex.requirements] has 16 paragraphs and
2 subsections.

Change-Id: I9093948278414644a416fffd1473fec7fdd2716c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-09-16 15:33:46 +00:00
Lars Knoll
8d6f2e7e15 Add a QT_REQUIRE_CONFIG(feature) macro
This macro expands into a static_assert and can be used to
trigger a compile error if a certain feature is not available
when trying to compile some code.

This is especially useful to protect against accidental inclusion
of headers that implement functionality related to a feature.

Change-Id: I456c55b989ce5f35f3af0e13c1886a85c23dfe29
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-09-16 12:27:59 +00:00
BogDan Vatra
31a63b6903 Say hello to Android 6+ permissions model
This API was introduced by Android v23 and is used in connection with
the new permission request system. From Android v23 onwards, some
permissions such as Location permissions cannot only be granted via
Android's Manifest files. An additional runtime check/request system
was introduced which forces applications to prompt the user
the first time a privileged function is called. Such user prompt
responses
are returned to the current application via the
Activity.onRequestPermissionsResult(..) callback.
This change add Qt API to nicely check & request permissions. For now
this is private
API which can be used to fix permission problems in other Qt
compontents. Later Qt versions will introduce a public API to
QtAndroidExtras.

[ChangeLog][QtCore][Android] Introduced a mechanism to forward
permission related callbacks on Activity objects to interested parties.

Task-number: QTBUG-55035
Task-number: QTBUG-50759
Change-Id: I64ee748d741b39e35c4713ed9fdd15dd1d96dc56
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2016-09-16 12:13:29 +00:00
Edward Welbourne
4ed59b90a1 Q(Date|Time)+::(to|from)String(): use C locale from Qt 6
We're using QLocale::system() by default for conversions between
date/time and strings; locale-dependency should be left to QLocale's
methods, so we should switch to using the C locale for the date/time
classes' methods, to make the results locale-independent.

Task-number: QTBUG-55632
Change-Id: I6ea6e8d2289e537f4d26eccf69a4f314c501f116
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 12:06:50 +00:00
Jake Petroules
6bceb4a8a9 Make QSslSocketPrivate::sslLibraryVersionString consistent on Windows
The returned string is now more similar to what the Apple (macOS, iOS,
tvOS, watchOS) version returns, and helps prepare for a later patch that
removes usages of QSysInfo::windowsVersion().

Change-Id: I5ba2937b27169ffc6624ccb4e608e6ff56a179bb
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-09-15 18:23:19 +00:00
Jake Petroules
eecc5fc52c Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/dev 2016-09-15 18:22:50 +00:00
Liang Qi
40a1f69e86 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	configure.json
	mkspecs/macx-tvos-clang/qmake.conf
	mkspecs/macx-watchos-clang/qmake.conf

Change-Id: Iaf32339ace59dff9ed344972472744c55d75025c
2016-09-15 19:47:57 +02:00
Ulf Hermann
6b3845320a QLocale: Add option to pad numbers with trailing zeroes
EcmaScript mandates that number-to-string functions pad the resulting
strings with zeroes, up to the requested precision. QLocale actually
supports this, under the disguise of the "Alternate" flag, used by
QString::asprintf().

We split this flag into the three options it actually represents and
make IncludeTrailingZeroesAfterDot available as a NumberOption. This
allows us to generate numbers in an EcmaScript compliant way.

In addition, a symmetrical option to reject trailing zeroes when
parsing strings to numbers is added.

[ChangeLog][QtCore][QLocale] Additional flags in QLocale::NumberOption
allow generating strings from doubles in accordance to EcmaScript's
Number.toPrecision(n).

Change-Id: If1090d5a0364a29811011a472afc8b75d0af0a8f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-15 16:01:02 +00:00
Anton Kudryavtsev
6b2071c697 Use QStringBuilder more to optimize memory allocations
Change-Id: I2939ffa10496fdc59e0402a9cb54458565ccd657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-15 09:08:45 +00:00
BogDan Vatra
bee70b24c1 Check the context of Q_ENUM[_NS] and Q_FLAG[_NS]
Change-Id: Ifc8cb50efe3b07a79c8afbb382fba12649b602b2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-15 08:55:32 +00:00
Allan Sandfeld Jensen
0a4d3a9218 Minimize register conversions in NEON optimization
Redoes the simple calculation of x coordinates in integer registers
rather than use the potentially expensive extract/move from NEON
register.

Change-Id: I914b463d6c20be2281710d626407196112d1615b
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-09-15 08:38:11 +00:00
Oswald Buddenhagen
e8091eb6c8 don't complain about missing QPA plugin on android
android is linux, but the QPA plugin is not enabled by configure, so
skip the warning here.

Change-Id: Ib136dd142b775a00686cdaa0cec5414d035c9516
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-09-15 08:24:20 +00:00
Oswald Buddenhagen
e4391bb403 make the style listing in the configure summary less weird
remove the redundant 'Style' suffix, and use CamelCased words (the list
uses space as a separator).

Change-Id: I169a741fdc293ac42ae6b97a5726477b53127506
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-09-15 08:24:16 +00:00
Lars Knoll
a668c6a6b6 Convert the old feature system
... to the new qmake based configuration system.

This removes the old qfeatures.txt (distributed over configure.json
files) and qfeatures.h (distributed over qconfig-<module>.h files).

qfeatures.prf is gone without replacement, as attempts to use it would
lead to followup errors anyway.

Change-Id: I1598de19db937082283a905b9592d3849d2199d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-15 08:24:10 +00:00
Lars Knoll
b22471edf9 Make things compile with the printer feature disabled
Always include qtprintsupportglobal.h before checking the
ifdef, and add ifdef's where they where missing.

Change-Id: I535dce33b26955fb0196ea05d54be41fe93e9151
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-15 08:24:04 +00:00
Oswald Buddenhagen
b754b2815d rename description => label in configure.json
"description" suggests something slightly longer.

this may seem like a gratuitous change, but the upcoming replacement of
the old feature system clarifies makes it seem much less so.

Change-Id: Ibe702e01cb146b59127bf1f990b4acaef1c61d55
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-09-15 08:24:00 +00:00
Lars Knoll
2d3c73fcfe Modularize configure.json/.pri
Move the different parts of configure.json/.pri into the libraries where
they belong.

Gui is not yet fully modularized, and contains many things related to
the different QPA plugins.

Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: I6659bb29354ed1f36b95b8c69e7fce58f642053f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-09-15 08:23:53 +00:00