Commit Graph

25677 Commits

Author SHA1 Message Date
Samuel Gaist
f7e9e035fd Fix cocoa plugin build with OS X 10.8 SDK
With the 10.8 SDK, NSArray may not respond to firstObject which ends the
build with an error. This implementation doesn't use it and also handles
the case where no screen is available when calling
qt_mac_mainScreenHeight

Change-Id: Idce278423c37cc24d8fc31062a386e78d6487492
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-10-18 21:00:10 +00:00
Thiago Macieira
f5eeadb92d Compile qmake and configure.exe in C++11 mode
Since the Qt headers require them now, we need to ensure that happens
properly.

Change-Id: Ib306f8f647014b399b87ffff13f14196c2c75bef
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-10-18 04:48:36 +00:00
Thiago Macieira
27361eadf1 Add a deprecation warning to configure about -no-c++11
We'll remove it in Qt 5.7, so people ought to be notified now.

Change-Id: Ib056b47dde3341ef9a52ffff13ef6caa91757a9f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-18 04:47:00 +00:00
Thiago Macieira
f430521392 Update mkspecs to use "c++11" instead of "c++0x"
We no longer support any compilers that don't know the actual version
number of the standard.

Change-Id: Ib056b47dde3341ef9a52ffff13ef154791dd0d22
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-10-18 04:46:45 +00:00
Thiago Macieira
b58fc66ed7 configure: Open qconfig.h, qconfig.pri and qmodule.pri only once
Redirecting on every command is wasteful.

Change-Id: I42e7ef1a481840699a8dffff1404fa0602805d1b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-10-18 04:46:12 +00:00
Maks Naumov
25e1f4549a QFileSystemModel: remove unused functor
Change-Id: I5809ebdfcd973336cf42735a1275b57f12e1823c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-10-17 19:30:41 +00:00
Marc Mutz
3845d1b830 QMetaObjectBuilder: replace index-based for loops with C++11 range-for
...for the recently-introduced std::vector objects
(QVector would detach).

Also, as a drive-by, reorder two comparisons so
the cheaper one is first, twice.

Saves 1700B of text size on GCC 4.9 optimized C++11
AMD64 Linux builds.

Change-Id: I05a29ef1f2e67c98d26236c2cc40a13856a91af6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-17 11:26:27 +00:00
Morten Johan Sørvig
068a545339 Add support for "@3x" image loading.
Implement as generic "@Nx" support in an exported
qt_findAtNxFile function.

3x devices now get one extra file existence test
in cases where @3x versions are not present. 1x
devices are still on the fast path where there are
no extra file system accesses.

Add an @3x image to the highdpi manual test.

Change-Id: I4ce3fc245ada01ea410abe1443ceb1e3abf7c17f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-10-16 21:47:25 +00:00
Thiago Macieira
9d1fab424e Make the C++11 atomic support the default, if available
Change-Id: Ib056b47dde3341ef9a52ffff13ef1647ccd607b1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-16 18:52:00 +00:00
Morten Johan Sørvig
c751cef8d6 Move QEventDispatcherCoreFoundation to QtCore
Export it for use by the iOS platform plugin. Also
move QCFSocketNotifier, and export for use by the
Cocoa platform plugin.

This is a pure code move with no intended behavior
changes, in anticipation of using the Core Foundation
event dispatcher as the default Qt Core event dispatcher
on OS X.

Change-Id: I43677d2f6f3c1d0ed0415c964225aa97d2f13078
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-10-16 18:07:32 +00:00
Daiwei Li
d40839db2f Android: Update splash screen in onConfigurationChanged
When the device orientation changes, we should set the background
to a drawable appropriate for that orientation.

Task-number: QTBUG-44238
Change-Id: I4ea50aedc704060c0b35c2d35b75cbaed3b4979a
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2015-10-16 16:32:56 +00:00
Tor Arne Vestbø
40b4c305d8 Check that QPlatformIntegration::createPlatformWindow() doesn't fail
We expect createPlatformWindow() to return a valid platform window. If
it fails we now assert in debug, and emit a warning in release. The only
platform where this is currently possible is on Windows, where the
platform plugin will return 0 if CreateWindowEx for some reason fails.

Change-Id: Ia2461efcfc48d180e073fa372d9c385650129e1c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-10-16 14:03:01 +00:00
BogDan Vatra
c63f4c5d01 Android: Set "immersive" mode on earlier android versions.
Most of "immersive" flags are available on earlier Android versions.

Change-Id: Ic4f03a3c9491570bc5f8c5afbb61669644b20d8e
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-16 14:02:46 +00:00
Timur Pocheptsov
5632375b86 Cocoa integration - fix Qt::WindowFullscreenButtonHint
Window collection behavior changed from OS X <= 10.9 to 10.10 to 10.11:
- the default behavior (0) included fullscreen button before 10.10, did not include
in 10.10, and now it's again included.
- it's not enough to exclude fullscreen - since the defualt is 0,
 0 & ~fullscreen does not help - we also have to set fullscreen
 auxiliary.

Task-number: QTBUG-48759
Change-Id: If427bd5cfa5c3cefc71f09dae7baa0d232601ee4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-10-16 14:00:47 +00:00
Edward Welbourne
1901adbab7 Split two error cases so they get reported distinctly.
If a macro is used with too few parameters, complaining about its
definition using '#' followed by something other than a macro
parameter name is apt to be confusing - reading the definition will
reveal that the name in fact is a macro parameter after all.  The
reader needs attention directed to the invocation, not the definition.

Split the test in two: one to test the prior error message does in
fact get produced for an invalid macro definition, the other to test
the invalid invocation case.

Task-number: QTBUG-46210
Change-Id: Ie177a56d346e553bf9d67e2008a4352633afa1ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-16 13:59:59 +00:00
Marc Mutz
dde8d5e3a0 QTextStream: add missing op<<(QStringRef)
It simply is missing. We could wait for QStringView to come around, but
I need this function in uic _now_, so let's add it.

[ChangeLog][QtCore][QTextStream] Can now stream QStringRef without converting
to a QString first.

Change-Id: Idd178e0ba8a89c025f4533d46de912cbdb3883d5
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-16 12:17:36 +00:00
Tor Arne Vestbø
e9835a3812 Document that QWindow::fromWinId() should be used with caution
Change-Id: I28c58fb720c323048615efe677a920f179ef9d20
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-10-16 12:13:39 +00:00
Tor Arne Vestbø
b37a548d08 Clarify foreign window documentation a bit
Change-Id: I50193cb0c106bc17a008e6778d2d722545c7cb1c
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-10-16 12:13:34 +00:00
Maurice Kalinowski
d49c0eb3fc WinRT: Initialize platform services
platformServices has not been created and caused a crash as soon as an
URL gets opened.

Task-number: QTBUG-48740
Change-Id: Ib099a0ff3007b168738e02c0fab8f9ca7bcd25c7
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-16 12:13:30 +00:00
Albert Astals Cid
5afc431323 Use Node::name if Node::logicalModuleName is empty for qml modules
Change-Id: I55693a4f34f0a89ceb326b5eb4b229dd3f91c172
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-10-16 11:24:29 +00:00
Thiago Macieira
4f829afc61 Turn C++11 on by default if the compiler supports C++11
[ChangeLog][Important Behavior Changes] qmake now enables C++11 support
by default if the compiler is known to support it (unless the compiler
defaults to C++14 or a later edition). To disable this, add to your .pro
file: CONFIG -= c++11. Note that Qt 5.7 will require C++11 support, so
it is a good idea to ensure your code works with that compiler
setting. (Note: it is not possible to disable C++11 support with
Microsoft Visual Studio)

Change-Id: Ib056b47dde3341ef9a52ffff13ef13ee2cf888eb
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-16 07:25:21 +00:00
Oliver Wolff
ffa7b050a1 winrt: Properly handle when a remote host closes a tcp connection.
Task-number: QTBUG-48476
Change-Id: I1933dfe7e73330a8f0d5ac8d3d7a834e0d77270a
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-10-16 04:34:40 +00:00
Samuel Nevala
49640d417f winrt: Wait for main thread to exit before exit.
This will allow application main to go out of scope and free objects
allocated there.

Change-Id: I7b7199ecf67afe578bac043f16b064c9daaae04a
Task-Id: QTBUG-48760
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-16 04:34:32 +00:00
Thiago Macieira
09d9af59f0 Fix left-shift wider than an int's width
The other left shifts in this file already have the Q_UINT64_C wrapper.
This one was missed.

Change-Id: I42e7ef1a481840699a8dffff140d758ac370c402
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-10-16 04:02:32 +00:00
Thiago Macieira
6f298be076 Add the QT_HAS_xxx macros for post-C++11 feature testing
And for compiler extensions. QT_HAS_BUILTIN and QT_HAS_ATTRIBUTE will
come in handy.

Change-Id: I255870833a024a36adf6ffff13ecf06624bfc1ef
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-16 04:02:24 +00:00
Marc Mutz
aa485aee2f QTextStream: optimize putString()
Instead of filling a QString with the padding characters, use a
QVarLengthArray. Do this only in the code path where it's actually
needed, and mark that code path as unlikely.

Change-Id: I11e04ccc4a07e16e430f2ea6dbb2f0f736908f5b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-15 22:27:31 +00:00
Marc Mutz
035f5478a5 tools: use QStringBuilder
src/tools/bootstrap was already compiled with QT_USE_STRINGBUILDER,
by way of load(qt_module), but the actual apps weren't.

Some apps become smaller, some larger; all (presumably) faster.

Change-Id: Idc8662e62ec14b27e730de9842bec295a1b5566e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-15 22:26:28 +00:00
Thiago Macieira
3d52b05a63 Add QNetworkInterface::interface{IndexFromName,NameFromIndex}
These are for faster lookups between ID and name when one doesn't need
the full information set about the interface.

Change-Id: I7de033f80b0e4431b7f1ffff13f98d448a705c3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-10-15 20:32:10 +00:00
Thiago Macieira
c9e2763909 syncqt: complain if a public header includes a private one
We should even cause syncqt to exit, but that would cause developers
trying to test something to be unable to. So leave it just with an
"ERROR" message. That is hopefully enough.

Change-Id: Ib056b47dde3341ef9a52ffff13ef5f8588b62b99
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-10-15 16:20:37 +00:00
Thiago Macieira
c401506ffc QDBusServer: Fix uninitialized member
If you used the QString constructor overload and passed an empty
address, the d pointer would remain uninitialized.

Found by Coverity, CID 11724.

Change-Id: I42e7ef1a481840699a8dffff1407ead3ee703d6e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-10-15 16:20:35 +00:00
Thiago Macieira
7dc0f42e78 QDBusConnection: Remove unused members
I can't find any use, ever, of them.

Change-Id: I42e7ef1a481840699a8dffff1407eb1a93b128a8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-10-15 16:20:32 +00:00
Thiago Macieira
34966bc84f QDBusPendingCall: Remove unused member
We set it to the number of types that the call expects to receive, but
we never used it anywhere else.

Change-Id: I42e7ef1a481840699a8dffff1407eb520b5844d8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-10-15 16:20:30 +00:00
Rainer Keller
7db9c610f1 Add processor types to blacklist keywords
This allows to disable tests that do not work on ARM machines.

Change-Id: I80b54da2978479e037b73ca3af87567e8d9d1b60
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-15 14:00:34 +00:00
Alex Trotsenko
53569c1383 QIODevice::seek(): remove unnecessary check
At this point, the buffer is always not empty, as otherwise the offset
could not be smaller than it.

Change-Id: Iec04c0463623c4ed1e86bbcba2240653f110e315
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-10-15 13:58:56 +00:00
BogDan Vatra
3674718e3d Dispatch all key and all generic motion events java objects to QtCore
These events are needed to enable the usage of all input methods available
on Android e.g. gamepads, stylus, etc.
In orer to get GenericMotionEvents your application min API version must
be at least 12, otherwise the application will receive only key events.

Change-Id: I7564fccaf5423aa318ba4f62317eaf101ba6e97e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-10-15 13:57:28 +00:00
BogDan Vatra
4f7e0bdc4c Android: Ensure all global objects are destructed
Android doesn't automatically trigger global objects destruction, so we need to do it ourselves.

Test case:

struct TestGlobal {
 ~TestGlobal() { qDebug() << " ~TestGlobal";}
} global;

int main() {
  return  0;
}

Change-Id: I32507c1cffebafc9841e9707a8f6711dcbd36281
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-15 09:49:39 +00:00
Richard Moe Gustavsen
0a00782608 QShortcutMap: enable extra debugging when Dump_QShortcutMap is defined
Dump_QShortcutMap is already made available in qshortcutmap_p.h, and if
set, "void dumpMap() const;" will be available to help debugging.
But unless QDebug &operator<< in qshortcutmap.cpp is also defined, the
dumpMap output will be pretty useless.

Change-Id: If8d535998ec01686eca25da73c2220062820a927
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-10-15 08:54:51 +00:00
Marc Mutz
361a4c1994 uic: updates from running generate_ui
(as of qttools:9ed1cfb27d7354cbc1020563569b8f65a3311303)

Change-Id: I2f539d2a20428cf167c04ea9f5881b1f5d58beb0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-10-15 09:03:44 +00:00
Erik Verbruggen
61be975574 QStateMachine: cleanup QAbstractTransition::setTargetStates
Prevent QPointer creation for every new target, and a copy of a QVector
of QPointer, and two QPointer destructions, when setting new target
states. The typical (only?) use-case, setting the target states right
after transition creation, is also faster.

Change-Id: I931783afbcea43c8a84200133f26454a4b689edc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 08:25:18 +00:00
Erik Verbruggen
6f34660340 QStateMachine: fix leak of delayed events.
When a delayed event is queued, the state-machine is responsible for
deleting it. Normal flow will ensure that: after the timer fires, the
delayed event is handled normally, which includes deletion. However,
when a timer cannot be set, the event was leaked. But more important: if
there were unhandled (delayed) events when the state-machine was
destoryed, the events were never deleted.

Change-Id: I7d8a6b572765dc1551ddbdebb446aaa3258680c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-15 08:25:12 +00:00
Marc Mutz
6951f0e4af QCompleter::splitPath(): don't get tangled up in strings
- Don't store "\\" as a QString just for passing it to QString:.startsWith()
  and prepend(). Keep it a QLatin1String.
  -> one allocation less

- Don't use said QString as a flag, use a bool

- Don't store QDir::separator() in a QString
  -> one allocation less
  -> two indexing operations less

- Don't retrieve QDir::separator() from said QString as QString(sep[0])
  -> one more allocation less

- Don't look for a QChar in a string by using QRegExp; use the QChar
  overload instead
  -> one more allocation (at _least_) less

- Don't convert QDir::separator() with QDir::fromNativeSeparators(); it will
  _always_ be '/'...
  -> one expensive function call less
  -> two QString allocations less
  -> one QString(QChar) introduced
     -> one allocation more
        -> could be removed with QStringLiteral/QString::fromLatin1Char()

Change-Id: I802e66685a95b08cfc557defc63e5f16a7e6306b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-15 00:45:11 +00:00
Thiago Macieira
2d2cb6434f Move the official Qt version from qglobal.h to .qmake.conf
It's easier to parse than qglobal.h. The objective is actually to have
macros with parts of the version number, so the major or minor numbers
could be used in other preprocessor macros.

Change-Id: I42e7ef1a481840699a8dffff1404eda1dd5c308d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-10-14 20:12:57 +00:00
Alexander Volkov
e912132886 xcb: Use XShape for DnD when a compositing manager is not running
Otherwise transparent areas of the drag'n'drop pixmap are painted
with the black color.

Task-number: QTBUG-45193
Change-Id: I55b7c7caababe13584fa1c7a52835f112e20f920
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-14 18:41:19 +00:00
Oswald Buddenhagen
4b9cdf90ca fix bogus complaints about prl targets without extension in bundles
the library inside a bundle doesn't have an extension.

this doesn't really fix anything except suppressing the error message,
as we discard the result of the operation anyway.

Change-Id: Idfe3d1714dedb59d9d3e86a65f074e516c431389
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-10-14 15:43:26 +00:00
Friedemann Kleint
957fb9fb82 qt_pixmapFromWinHICON(): Fix crash and leak in case of Win32 API fails.
Release the DC and move alpha-checking into separate function
to prevent it from using invalid width/height.

Task-number: QTBUG-48732
Change-Id: Iaf7cfa89b0f702f5012b0451d24a9e887d832c59
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-10-14 14:59:17 +00:00
Oswald Buddenhagen
bc00f3c228 fix the trailing-backslash-in-DESTDIR-on-mingw workaround
at least the mingw version we use now interprets the sequence \# as a
literal hashmark, which completely defeats the previous hack.

the new hack escapes the backslash with another backslash, which appears
to work. however, make does *not* remove the additional backslash, so
the result is a bit ugly.

Change-Id: I591a2be443880b162094d04e5a5e624216b59311
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-14 14:57:54 +00:00
Tor Arne Vestbø
233d0a6b8d Add default argument to QPlatformWindow::isEmbedded()
Removes magic 0-pointers at the call sites.

Change-Id: I6740f6b8cc75004ab5f2ebcb3b3c95cbbdc43153
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-14 14:22:54 +00:00
Tor Arne Vestbø
26a89e7bf7 Don't use d_func in QWindow::mapToGlobal
We initialize the variable d at the top using Q_D(const QWindow);

Change-Id: I2de3b33c043024c5599b7cd1ebecae2db0b39d87
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-14 14:22:40 +00:00
John Lindgren
5d5e0a4e97 Avoid triggering OpenGL initialization for RasterSurface
Application that do not require OpenGL need a way to opt-out of
GLX/EGL calls completely. The initialization can be expensive and what
is more, some systems may not have functional GLX at all (some VMs are
known to crash when trying to get FBConfigs for the window).

QApplication already has AA_ForceRasterWidgets, which causes the use
of plain RasterSurface everywhere instead of RasterGLSurface. Combined
with a trivial check in the xcb backend to skip all the Xlib+GLX/EGL
path, the attribute will allow apps to ensure that no GLX/EGL calls
are ever made.

This however implies a change in QWindowContainer: the embedded window
must use the same initialization path as the parent otherwise we will
end up with a BadMatch. QWindowContainer can do this transparently to
the applications, unless the QWindow is already created.

Change-Id: I846af7edb8b92b9836cdbd93c6a5eec5a6147a49
Task-number: QTBUG-46765
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-10-14 14:11:14 +00:00
Laszlo Agocs
715a8e6f4e Avoid image copy in toTexture() on GLES 3.0 as well
The default backingstore implementation is now cleaned for ES_2 ifdefs.
All the checks are now done at runtime and ES 3.0+ is included as well
for the efficient, QImage::copy()-less path.

For embedded a customized backingstore is used so the change has to be
done separately there.

This should result in a slight improvement for QOpenGLWidget/QQuickWidget
when running on GLES 3.x.

Task-number: QTBUG-37624
Change-Id: I107330c25a993c5cdcd92e4ebdc17ae172a03da8
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-10-14 14:11:07 +00:00