Commit Graph

29750 Commits

Author SHA1 Message Date
Liang Qi
50908f023d Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/plugins/platforms/ios/qiosviewcontroller.mm

Change-Id: I2dda31867cbc79ea7fe965f52afb518aefa4ad20
2016-09-22 07:28:34 +02:00
Jake Petroules
c2869c3b0a Pass -quiet to xcodebuild when invoking make with -s option
This makes use of the new -quiet option in xcodebuild 8 to reduce the
noisiness of output when make is invokved in silent mode.

Change-Id: I3730dddcc1d9dae329b5ff254448533cdd573a30
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-09-21 21:42:22 +00:00
Olivier Goffart
7c5cf8b2bd Fix bootstrap applications crashing when QT_MESSAGE_PATTERN contains %{backtrace}
tokens[i] was left uninitialized. This could cause a crash when moc produces a
qWarning.

Task-number: QTBUG-56045
Change-Id: I6fba933005edd29756f0d6b1cfe53243254ac7b2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-21 13:22:54 +00:00
Liang Qi
7555a92581 Merge remote-tracking branch 'origin/5.7' into 5.8
5971b88e is not needed in new configure.

This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with
apple SDK", 2c9d15d7, because it breaks iOS build with new
configure system.

Conflicts:
	mkspecs/features/default_pre.prf
	mkspecs/features/mac/toolchain.prf
	mkspecs/features/toolchain.prf
	src/dbus/qdbusconnection.cpp
	src/plugins/sqldrivers/mysql/qsql_mysql.cpp
	src/sql/drivers/mysql/qsql_mysql.cpp
	src/widgets/widgets/qmenubar.cpp
	src/widgets/widgets/qmenubar_p.h
	tools/configure/configureapp.cpp
	tools/configure/environment.cpp
	tools/configure/environment.h

Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
2016-09-21 11:57:52 +02:00
Liang Qi
d10e4c193b Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I9cfefaf22b010fca937be77979f5fb50574bb71e
2016-09-21 07:14:40 +02:00
Takumi ASAKI
25e9bde2d6 Bearer/ConnMan: Fix getTechnologies() is not called
Change-Id: I4e39c971198583af815f5bcecaad4a9c52e5d2dd
Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
2016-09-21 00:46:10 +00: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
Samuel Gaist
23e76a12b9 Doc: add macOS example of QAbstractNativeEventFilter implementation
This patch adds a sample native event filter that can be easily
integrated in a project.

Task-number: QTBUG-53209
Change-Id: Iedf6df33a3de5b01dc7871cca5e7897a5b485733
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-09-20 21:23:32 +00:00
Samuel Gaist
9f2c260f88 Add missing test for QReguarExpression for QTextDocument::findMultiple
Change-Id: Ia9b3eb21a178da4ae2844dba37b7e1cc669d6b50
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-20 21:23:08 +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
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
Richard Moe Gustavsen
8347b54b97 iOS: open menu on popup regardless of visibility
It should be possible to show a menu by calling showPopup, even if
visible is set to false. After all, it's only logical that visibility
is false before showing it. And whether or not the menu is
enabled should not matter as well.

Change-Id: I9a2b453c8c6e88c47812c652d99e4b4a9c7524a7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-19 11:20:58 +00:00
Richard Moe Gustavsen
e32ecdb280 iOS: explicit synthesize properties as readwrite
The synthesized properties were defined as (read only)
methods in the UIViewController API in iOS9, and we
extended them into readwrite properties in our own
sub class to enable some local bookkeeping in addition
to normal overriding.

But in iOS10, Apple has changed the methods into being
readonly properties instead. The difference then is
that automatic property synthesizing
will ignore our local readwrite declarations, and use
the declarations in the super class instead. And this
will lead to a runtime crash on iOS10 since no
setter methods are generated.

This patch will instead explicit synthesize the affected
properties to ensure that both getters and setters will be
generated.

Change-Id: Iac330e991b8a0fe335e383e1f7d9ff30c0ce1559
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-19 11:20:50 +00:00
Richard Moe Gustavsen
d3389a6d46 iOS: let quiview conform to API signature changes in iOS 10
In the iOS 10 SDK, method signatures has been annotated with
NS_ASSUME_NONNULL macros and 'nullable' keywords. This means
that certain methods should not be called with argumens
that can be null, or in this case, set to 0 explicitly. The
result will be compiler warnings.

This patch will rewrite the explicit call we do to touchesCancelled
so that we send an empty set instead of 0.

Change-Id: I50aa80b91312397d17e0e380815adff87cee852b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-19 11:20:44 +00:00
Frederik Schwarzer
e30d0e462f QAbstractProxyModel: fix sentence structure in apidoc
Change-Id: Ib3371549ecb80da326260b1df431f20e7a04f07e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-09-19 11:17:58 +00:00
Tor Arne Vestbø
fecee98836 multiwindow: Base vsync debug output on actual surface format
Allows us to detect cases where the requested vsync combination was
not possible to fulfill.

Change-Id: Ie8f3665129f7a1ab7fcefb94b2298d54520b753a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:53 +00:00
Tor Arne Vestbø
efdecff085 multiwindow: Replace per window fps timers with unified approach
The FPS is now calculated and output on the command line in a single
place. The animated fps counter has been replaced with a vertical line
which should make it easier to observe tearing issues when vsync is
disabled.

Change-Id: Id356fc1958c048d85aba48edfed59124454038d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:33 +00:00
Tor Arne Vestbø
880beb121e multiwindow: Call update() after swap
Change-Id: Ic2c26339bce9fe92b2ccc730c72f53ce94397b78
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:28 +00:00
Tor Arne Vestbø
44fec65624 Update swap interval of QCocoaGLContext after creation
QSurfaceFormat is recreated from scratch, and by not reading back the
swap interval the QCocoaGLContext seemed to be vsynced even if it
actually was not.

Change-Id: I72ddaae9a4c695fe4c74d7b4b70ca9db84bcc084
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-09-19 00:42:23 +00:00
Tor Arne Vestbø
6ce96fdbf5 multiwindow: React to mouse press to allow debugging UI responsiveness
The animated FPS counter should be enough to observe smooth animations,
so we use the color of the window to visualize frame latency.

Change-Id: I1171a1c4bdc261ca8655771290c6735357821781
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:20 +00:00
Tor Arne Vestbø
bcbc8120b3 multiwindow: Use showNormal() instead of show() to ensure normal geometry
Change-Id: Ice607f536a620da5a70f2ba066f4983bb78c6288
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:04 +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
Marc Mutz
8082c0dc81 QBrush: Fix UB (non-virtual dtor) in QBrush::detach()
As the d-pointer, QBrush uses a QScopedPointer with a
custom deleter that checks for QBrushData::style and
casts the QBrushData pointer down to corresponding
subclasses before calling delete on them.

In QBrush::detach(), however, any of the three brush
data classes were held in a QScopedPointer _without_
the custom deleter, invoking UB when that scoped
pointer would ever get to be the one that deleted
the payload instead of handing it over to the objects
d-pointer.

Found by making dtors protected following a Coverity
report wrongly marked as 'dismissed' (these static
checks are not included in this patch, since they
are binary-incompatible), to find out where Coverity
could possibly see a problem.

Also replace the d.reset(x.take()) that allowed this
mismatch to compile with d.swap(x), which nicely
ensures that x and d are of the same type.

Coverity-Id: 11772
Change-Id: I85e2c205df9291bd7508b6c90f7b03fbe8c3bcd2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 17:59:24 +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
29d64bc8e0 QEvdevKeyboardHandler: use RAII in create()/ctor
Coverity somewhat rightfully complained that the FD may be leaked in
certain cases, e.g. when the new-expression throws. Yes, the plugin
is compiled with exceptions disabled, but the code is still a bug
waiting to happen, because it's too easy to just add an early return
to the function and leak the FD that way.

Fix by writing a small RAII class for FDs (can't use QSharedPointer,
since it's not a pointer we're dealing with). It's quite generically
named, in anticipation that it might come in handy elsewhere, too.

Coverity-Id: 89046
Change-Id: I83d1ed3f11219065d2248c129ed191a651f617c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 10:55:27 +00:00
Albert Astals Cid
8d64d1e0c3 xcb: Do not eat events with different keyboard state
Change-Id: Iac8dc7b369eb7c2fbe0cf27baa34a40278088219
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2016-09-18 10:34:53 +00:00
Albert Astals Cid
76adb6c29f xcb: Use the state of the key event to process it
Instead of the global state

Task-number: QTBUG-48795
Change-Id: Ic2c545718adb68df41730e5a3bf25adb374ffce3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2016-09-18 09:56: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
BogDan Vatra
734da261a8 Android: Don't hang when resuming the application
If the main thread is blocked updateApplicationState will hang. It
happens when we're using functions like runOnAndroidThreadSync or
requestPermissionsSync.

Change-Id: Ic1135c5630b48cf1076ef5cbc133933fce439bfb
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2016-09-17 07:38:15 +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
Liang Qi
bd4d847903 Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-09-17 03:11:41 +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
Liang Qi
d148019f16 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp

Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
2016-09-16 23:16:25 +02:00
Thiago Macieira
597d625c2c Disable forcing of -fomit-frame-pointer with ICC
qlogging.cpp(1226): error #3175: unrecognized gcc optimization level
  __attribute__((optimize("omit-frame-pointer")))
                          ^

Change-Id: I33dc971f005a4848bb8ffffd14748b100dcefa95
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-16 20:50:05 +00:00
Liang Qi
6b9c57f8cd Merge "Merge remote-tracking branch 'origin/5.6.2' into 5.6" into refs/staging/5.6 2016-09-16 18:18:29 +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
James McDonnell
8a2401bd45 Switch to 7.0 screen property names
The names of some screen properties have changed in 7.0.

For 6.6, map the 7.0 names to 6.6 names.

Change-Id: Iaf9d297fdd6a0329a84150f2b9a27665d89cc1ec
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-09-16 13:21:18 +00:00
James McDonnell
71e195f6ef Reverse the flush-screen-context test
It was backwards so the screen context was being flushed on every screen
interaction when the parameter was _not_ specified.  During mouse/touch
movement, the number of flushes can be so great that it negatively
impacts performance.

Change-Id: I4dfe9c33c8ce31237db1d78db1cb8e04c00c4dd3
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-09-16 13:21:07 +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
a95d81e786 Q(Date|Time)+::(to|from)String(): mention relevant QLocale methods
The const QString &format variants of these methods lack adequate
control over the locale used; the Qt::DateFormat variants give only
limited control over the format string.  So reference the QLocale
methods that provide the general case, in the docs of each.  Also made
the \sa cross-referencing among these methods a little more coherent.

Task-number: QTBUG-55632
Change-Id: Icd0c8548045e74879e941ba089c3bdea78f14e34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 12:07:05 +00:00