Commit Graph

24298 Commits

Author SHA1 Message Date
Marc Mutz
742c6ff5dc tst_QStateMachine: replace inefficient QLists with QVector
It's just a test, but it's in the way of automatic tracking
of inefficient QLists.

Change-Id: I2dcfd81c9e208dab57bb256d7c276ad5303f196c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-17 07:10:11 +00:00
Marc Mutz
b9331eff91 QMetaObjectBuilder: replace an inefficient QList with QVector
ints are only half the size of void* on 64-bit, so
QVector<int> uses only 50% of per-element memory,
compared to a QList.

Saves ~1800B of text size on GCC 4.9 optimized C++11 AMD64
Linux builds, even though it wasn't the last instance of
QList<int> in QtCore, yet.

Change-Id: Ibf04b26cff78c428e4253aaab7c280866906db58
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-17 07:10:06 +00:00
Marc Mutz
d4cee10bf8 QMetaObjectBuilder: replace inefficient QLists with QVector
The QMeta*Private classes are larger than a void*, and weren't
marked as movable, so QList<QMeta*Private> is horribly inefficient.

Fix by holding them in QVector instead. Saves ~900B in text size
on GCC 4.9 optimized C++11 AMD64 Linux builds, and tons of memory
allocations.

Change-Id: I313c965d7a0fea16f79e9fde04a972fc248e33aa
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-17 07:10:02 +00:00
Marc Mutz
2d9700c041 QPointer: add member-swap
Change-Id: I5704badc86f98e549c586656ec8df3915632ce15
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-17 07:09:57 +00:00
Marc Mutz
9f1646b0d9 qDBusRealAddTimeout(): don't create a QList just to check it's empty
Instead of QHash::keys(value).isEmpty(), use QHash::key(value, 0) == 0
(0 is used a failure indicator three lines down, so it should not be
a key in the hash table).

Change-Id: I75cc4f7f7540dc5c51a7b8e3add09a0ec6a75e05
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-06-17 07:09:52 +00:00
Marc Mutz
dd788e0dc8 QButtonGroup: don't create a list just to find the minimum element
Change-Id: Ibd66ad81264abbe804db2bae48823966d5e4f449
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-17 07:09:46 +00:00
Ulf Hermann
7c34ea1fc7 Don't define qAccessiblePlugins if we cannot use them.
In case of QT_NO_LIBRARY there are no plugins after all.

Change-Id: Iad891d0cf0edf9e4418a4fe4ac49cf6497ceeb79
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-16 14:31:00 +00:00
Ulf Hermann
ef0f7f4248 Unify QByteArray::MaxSize and MaxAllocSize
We have established the maximum size qAllocMore can deal with in
commit 880986be23 and we should use
it.

The maximum size for byte arrays is reduced by one byte as with
the previous code we could make qAllocMore produce ((1 << 31) - extra)
by passing (1 << 30). That is not a problem for qAllocMore itself
(as long as extra > 0) but it's hard to verify that no related
code casts the total sum back to signed int, which would overflow
to -1.

To make the compiler inline access to the maximum size, a private
enum MaxByteArraySize is provided, which can be used in internal
code.

This fixes the merge of commits
880986be23 and
c70658d301

Change-Id: Idb04856f7c2e53ef383063e7555d3083020ff2b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-16 14:30:45 +00:00
Friedemann Kleint
8d5516b585 Add check for top level widget leaks in kernel test of QtWidgets.
Add a cleanup function for the check and disable animations
in tst_qwidgetaction to prevent effect widgets from interfering
(vista style animations).

Change-Id: I043ecb131c8dcd07b6ef10bc75c9e010ab569e85
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-16 14:14:18 +00:00
Friedemann Kleint
05fa4ac7df configure.exe: Fix detection of DirectWrite for MinGW.
Check on the correct library name.

Change-Id: I10980a8ba3e3e96d368319af0d86d6fb339c03ff
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-16 14:14:09 +00:00
Paul Olav Tvete
0bd936e7f3 Compile fix for QT_DEBUG_ANDROID_IM_PROTOCOL
Change-Id: I45d1c1541f8c758995c988f52c5fa8bd4fa99177
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-16 12:14:09 +00:00
Paul Olav Tvete
cef33870e4 Workaround for Google Keyboard strangeness
When deleting selected text, Google Keyboard will call
deleteSurroundingText() with a negative beforeLength. This does
not make any sense, and not all our controls are able to handle
the resulting input method events.

This patch interprets a negative beforeLength as a positive
afterLength. This works with the cases I have seen so far, but
since the keyboard is not following the specification, there
may be more weirdness later.

Task-number: QTBUG-46637
Change-Id: I410832417f6fb21139c338355e8fcfa57b9e544c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-16 12:13:58 +00:00
Laszlo Agocs
fb8b3e1bee Fix GLX backend in static builds
Do not attempt to resolve dynamically in static builds. This is not
wrong, but if the GL library is statically linked just like the rest
of Qt, it won't work. Therefore just call the function directly in static
builds, it should be no problem on modern systems.

Task-number: QTBUG-46499
Change-Id: I35fd7c3b5b180d753becbb57377b27dd1a8747ad
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-06-16 12:04:35 +00:00
Laszlo Agocs
0ce2edc56a Fix gles lib loading on Android
Setting the version breaks on Android as it has no .so versions, leading
to aborting apps on devices that support GLES 3.x.

Change-Id: Id4381e08a2615a0898def8f075ce5a5c5b9c7a7d
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-16 12:04:29 +00:00
Mark Brand
8bbd56c845 update bundled sqlite to 3.8.10.2
The "Fixed CE build of sqlite3" patch is preserved in this change,

Change-Id: I3073b51ea51403fa0011b78a510cd90b34b01068
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-06-16 11:34:14 +00:00
Thiago Macieira
4bfeac8ed3 Add changelog for 5.5.0 in qtbase
Change-Id: I049a653beeb5454c9539ffff13e6233c123f8da7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-16 11:33:53 +00:00
Richard Moe Gustavsen
b5220d9dff pbuilder_pbx: disable bit code for Xcode projects
With Xcode7, Apple added support for compiling apps to bit code
instead of binary (*). But this is only supported when the deployment
target is at least 6.0. And in Qt-5.5, the deployment target is
still set to 5.1.1. The result is that every Qt application will fail
building once people move to Xcode7.

Instead of bumping the deployment target (which we plan to do
for Qt-5.6), we choose to switch off bit code for now.

 *: https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html

Change-Id: I23001563439a7726506b7cd2dc77a82533b8a27b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-06-16 11:33:47 +00:00
Oliver Wolff
1de6fd49d1 Use "Ex"-versions of WaitForSingle/MultipleObject(s) where possible
Not only should using the "Ex"-versions be the rule and not the
exception on Windows, but it's only the only way to share as much
code as possible between Desktop Windows and WinRT (which is pushed
by Microsoft a lot). The current rule of Desktop and WinCE vs WinRT
does not make a lot of sense any longer, as WinCE is getting less
and less important. By moving these #ifdefs in favor of WinRT,
WinCe code might be removed easier in the future.

Change-Id: I0ef94fb14fbf8add9c2dfa2a3fb8036d25fb697d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-16 06:40:27 +00:00
Olivier Goffart
d3ad8cff17 Make sure the QDockAreaLayoutInfo item_list is detached when we are going to modify it
This can lead to situations in which the gap item ends up in the
saved state
'subinfo' is owned by the item, but the const-ness is not transferred to
the pointer. So calling a non const function (unplug) that changes the
subinfo changes it in the original list as well.
This is a problem because that list might be shared with the saved state.

Change-Id: I90a5faafea5958043db610a84c069494f2e48137
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jocelyn Turcotte (Woboq GmbH) <jturcotte@woboq.com>
2015-06-16 06:36:05 +00:00
Ulf Hermann
d7e2e943a2 Fix conditions for disabling dbus dynamic symbol lookup
We cannot do this if no library support is present. Incidentally that's
the case when bootstrapping, but you can also set the flag manually.

Change-Id: I51e167176d0839af5858122630ef623a1c69a106
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-06-16 06:31:42 +00:00
Kai Pastor
fefa8cf392 Fix boundingRect test in tst_QPicture
Verify the bounding rect of the left hand side of copy/assignment,
not the right hand side (which is passed by const ref).

Change-Id: I5044d269fe0acb5f4484c82da7e030ca33958792
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-16 06:11:58 +00:00
Allan Sandfeld Jensen
46e8ac0308 Extend generated style strings to include new font weights
When a font style-name is not directly available from the font we
need to generate it with the data we have, so we should include all
the new supported weights.

Change-Id: I45cc0114f8c76f45bc7a639f9d0d8096a064bc51
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
2015-06-15 23:16:07 +00:00
Thiago Macieira
7c8b3699bf Let QtTest use an alternate stack for its signal handlers
Otherwise, the handler can't be called for a stack overflow.

Change-Id: I5d1e6f7607404caa96e4ffff13e7fabd66011785
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2015-06-15 22:19:12 +00:00
Marc Mutz
d3cb97172f Micro-optimize QKeySequencePrivate::decodeString()
Use a QStringRef instead of a QString.

Change-Id: I63bf9775606b071cd9614306375e1316dada9f61
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-15 18:31:49 +00:00
Laszlo Agocs
3d5612de98 Add a synthesized-by-application value to mouse event source
Task-number: QTBUG-46669
Change-Id: I5567a9fe7ed8a80cd08830250c02f7252fa79bf8
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-06-15 17:16:17 +00:00
Olivier Delbeke
28ceb2ea5e Added SSL support for MySQL database connections
Addition of new options SSL_KEY, SSL_CERT, SSL_CA, SSL_CAPATH and SSL_CIPHER
to allow SSL-encrypted connections to MySQL databases.
When needed, these options must be specified in the function call
QSqlDatabase::setConnectOptions() before the call to QSqlDatabase::open().

SSL_KEY = the path name to the key file
SSL_CERT = the path name to the certificate file
SSL_CA = the path name to the certificate authority file
SSL_CAPATH = the path name to a directory that contains trusted SSL CA
certificates in PEM format.
SSL_CIPHER = a list of permissible ciphers to use for SSL encryption.

These options replace CLIENT_SSL (which should not be used any more).

Example:
    db.setConnectOptions("SSL_KEY=client-key.pem;" \
                         "SSL_CERT=client-cert.pem;" \
                         "SSL_CA=server-ca.pem");

[ChangeLog][QtSql] SSL support for MySQL database connections has been added.
Option CLIENT_SSL replaced by SSL_KEY, SSL_CERT, SSL_CA, SSL_CAPATH and
SSL_CIPHER, so that the keys, certificates and cipher can be specified.

Task-number: QtBUG-3500
Change-Id: I8197234b169a818658678d6fcc953c90e83db23e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2015-06-14 15:49:24 +00:00
Marc Mutz
61ca116a2e QTest: Make qExtractTestData() return the created QTemporaryDir
... and enable auto-deletion on it.

This allows users of the function to get rid of their own
cleanup code. They just need to keep the shared pointer alive
for as long as they need it.

Drive-by changes:
- replaced QStringLiterals that were only used as the rhs of op+
- replaced an instance of mid() used as the rhs of op+ with midRef()
- enabled NRVO

Change-Id: I161d39461e020c9e8d473c0810dea2109fe0d62d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-14 15:19:31 +00:00
Daniel Molkentin
d3379cee8a Document -secure-transport parameter in configure
Change-Id: Iea658e37b681c54de35307b1e587adf0efd70970
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-06-14 15:19:22 +00:00
Simon Hausmann
bca41b1b85 Improve back trace handling
Print the full backtrace including the values of all variables, for
improved diagnostic analysis.

Change-Id: Iffcaa08123599e3610cdc2e316627167bfff0f36
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-14 13:12:43 +00:00
Simon Hausmann
f3939d943e Blacklist and skip various tests that are flakey
They didn't show up in the "old" CI runs because they usually pass the second
time they are executed - which the testrunner does. The new CI doesn't do that
anymore, instead we now mark those tests explicitly and will track their record
of passing and failing in the new metrics database.

Change-Id: Id34dd6f792f38995b07b6fec88f833df64de2f8b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-14 10:50:45 +00:00
Alexander Volkov
1d9a6d0859 xcb: Set _NET_WM_WINDOW_TYPE from a single place
Merge QXcbWindow::setNetWmWindowFlags(), which was called from
QXcbWindow::setWindowFlags(), into QXcbWindow::setWmWindowType().
Now setWindowFlags() can't override window type set by
QXcbWindowFunctions::setWmWindowType().

Also reorder _NET_WM_WINDOW_TYPE atoms in QXcbWindow::setWmWindowType()
as it was in Qt 4.

Change-Id: Id1752d78f91caf04e9d16bb1ac40ed180597df7b
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-06-13 08:45:11 +00:00
Simon Hausmann
630855263a Blacklist tst_QThreadPool::expiryTimeoutRace() on OS X
Sometimes it works and sometimes it hangs. This is the back-trace
when it hangs:

 FAIL!  : tst_QThreadPool::expiryTimeoutRace() 'task.semaphore.tryAcquire(numTasks, 10000)' returned FALSE. ()
    Loc: [tst_qthreadpool.cpp(380)]

 ========= Received signal, dumping stack ==============
 (lldb) process attach --pid 31360
 Process 31360 stopped
 Executable module set to "/Users/qt/work/qt/qtbase/tests/auto/corelib/thread/qthreadpool/./tst_qthreadpool.app/Contents/MacOS/tst_qthreadpool".
 Architecture set to: x86_64-apple-macosx.
 (lldb) bt all
 * thread #1: tid = 0x11f82a, 0x00007fff87451716 libsystem_kernel.dylib`__psynch_cvwait + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
   * frame #0: 0x00007fff87451716 libsystem_kernel.dylib`__psynch_cvwait + 10
     frame #1: 0x00007fff8102dc3b libsystem_pthread.dylib`_pthread_cond_wait + 727
     frame #2: 0x000000010b160dab QtCore`QWaitConditionPrivate::wait(unsigned long) + 75
     frame #3: 0x000000010b160c62 QtCore`QWaitCondition::wait(QMutex*, unsigned long) + 162
     frame #4: 0x000000010b15d66a QtCore`QThreadPool::~QThreadPool() + 106
     frame #5: 0x000000010b0c6bec tst_qthreadpool`tst_QThreadPool::expiryTimeoutRace() + 380
     frame #6: 0x000000010b0ccabb tst_qthreadpool`tst_QThreadPool::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 139
     frame #7: 0x000000010b3138e2 QtCore`QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const + 1026
     frame #8: 0x000000010b312f0a QtCore`QMetaObject::invokeMethod(QObject*, char const*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) + 2122
     frame #9: 0x000000010b0ec18f QtTest`QTest::qInvokeTestMethod(char const*, char const*, QTest::WatchDog*) + 1535
     frame #10: 0x000000010b0e7847 QtTest`QTest::qExec(QObject*, int, char**) + 1447
     frame #11: 0x000000010b0cc954 tst_qthreadpool`main + 132
     frame #12: 0x000000010b0c4e74 tst_qthreadpool`start + 52

   thread #2: tid = 0x11f82c, 0x00007fff87452662 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
     frame #0: 0x00007fff87452662 libsystem_kernel.dylib`kevent64 + 10
     frame #1: 0x00007fff88af1421 libdispatch.dylib`_dispatch_mgr_invoke + 239
     frame #2: 0x00007fff88af1136 libdispatch.dylib`_dispatch_mgr_thread + 52

   thread #3: tid = 0x11f82e, 0x00007fff87451e3a libsystem_kernel.dylib`__wait4_nocancel + 10, name = 'QThread'
     frame #0: 0x00007fff87451e3a libsystem_kernel.dylib`__wait4_nocancel + 10
     frame #1: 0x00007fff81911090 libsystem_c.dylib`system + 425
     frame #2: 0x000000010b0e6fa6 QtTest`stackTrace() + 150
     frame #3: 0x000000010b0efd1d QtTest`QTest::WatchDog::run() + 77
     frame #4: 0x000000010b15f723 QtCore`QThreadPrivate::start(void*) + 339
     frame #5: 0x00007fff8102b899 libsystem_pthread.dylib`_pthread_body + 138
     frame #6: 0x00007fff8102b72a libsystem_pthread.dylib`_pthread_start + 137
     frame #7: 0x00007fff8102ffc9 libsystem_pthread.dylib`thread_start + 13
 (lldb) quit
 ========= End of stack trace ==============
 QFATAL : tst_QThreadPool::expiryTimeoutRace() Test function timed out
 FAIL!  : tst_QThreadPool::expiryTimeoutRace() Received a fatal error.
    Loc: [Unknown file(0)]

Change-Id: I12a61496e101c1bc04bb7f1141c4f6318e8238e4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-12 14:35:53 +00:00
Sérgio Martins
80da7792f7 core: Add several QList::reserve() calls.
Reduces reallocations.

Change-Id: Ib63539fb690a80245d8fe81ff8468e79ffa8e57c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-12 14:29:34 +00:00
Ulf Hermann
5ab74ffca1 Namespace copy of QFileSystemIterator in QDirIterator benchmark
Otherwise you cannot link it statically against QtCore.

Change-Id: I4ac35602cea2192974f3e96ecad35edac976ce27
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-12 13:52:55 +00:00
Ulf Hermann
53b83ac413 Don't try to load opengl extensions or functions without QLibrary
Change-Id: If77ca6e04c83d94fd3063b68963b1bcd90980d99
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12 12:36:42 +00:00
Holger Hans Peter Freyther
8b81f89dff Delete the d_ptr in the destructor
The d_ptr variable is introduced by QGLCustomShaderStage and
needs to be fully handled by it. Delete the d_ptr in the dtor

Fixes Coverity CID #10995.

Change-Id: I76bf05206acf23363419afc95094f5593e808a2e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12 12:18:03 +00:00
Andreas Hartmetz
ef21a8dea3 evdevtouch driver: fix indentation.
Change-Id: If9ef172bda6488c4516a5e0577d6b233bd2ed1ad
Reviewed-by: Mikko Harju <mikko.harju@jolla.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12 12:14:41 +00:00
Ulf Hermann
2cbd318f1d Don't try to load plugins if QT_NO_LIBRARY is set.
Any plugin loading is impossible then and the code won't even compile.

Change-Id: I81e49ff87ae1a609521d526f5098a0d44cc28f7c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-12 11:57:07 +00:00
Olivier Goffart
7f85fb4654 Allow types with a comma in Q_PROPERTY
This allows for example properties with QMap<Foo, Bar>

[ChangeLog][QtCore] Types in the Q_PROPERTY macro can now contain commas
(for example, QMap<Foo, Bar>)

Change-Id: Ibf5c8c9cf20a7c8b3dfec9e891fb8a9ca1bdba7c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-12 11:36:32 +00:00
Morten Johan Sørvig
55df2e54a5 Fix Qt-in-namespace build breakage.
Objective-C classes must be forward declared in the
global namespace.

Change-Id: Ic4818cef4b61f1578c478da9c30b77237262b283
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-06-12 08:17:52 +00:00
Ulf Hermann
0ff3bbe293 Mark unused parameters with Q_UNUSED
This prevents compiler warnings on less common branches of certain
ifdefs.

Change-Id: I89bae68491151b21cf6887a854cc4c9f68838cf9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-12 08:09:21 +00:00
Joerg Bornemann
2a0c003e6b fix decoding of file paths in QLockFilePrivate::processNameByPid
QFile::decodeName should be used instead of a simple QString::fromUtf8.

Change-Id: I76955ab01af55dd373f860f6e3dbffa37e60892c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-12 08:00:43 +00:00
Joerg Bornemann
b23f1d2c8b fix unterminated char buffer glitch
readlink does not append a NUL character to buf. If readlink places
PATH_MAX characters into buf, then an unterminated character buffer
would have been passed to QString::fromUtf8.

Change-Id: Ib1865b8df760fa7da91c3be746dc701a165d93ee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-12 08:00:38 +00:00
Marc Mutz
e593891b15 Add qHash(QSizePolicy)
Size policies can be compared for equality,
so qHash should be overloaded, too.

[ChangeLog][QtWidgets][QSizePolicy] Added qHash(QSizePolicy).

Change-Id: Id219f47ac6cb236efdd73cad7b892c8efd034d5c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-06-12 07:48:24 +00:00
Friedemann Kleint
d0f64542c8 Output registered enumeration names in QCOMPARE.
Produces output:

FAIL!  : tst_qquickwindow::cursor() Compared values are not the same
   Actual   (clippedItem.cursor().shape()): ForbiddenCursor
   Expected (Qt::ArrowCursor)             : ArrowCursor
   Loc: [tst_qquickwindow.cpp(1465)]

Change-Id: I8a9dfa099a6011cbe0c07da683d4be3d07e22d5d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-12 07:48:22 +00:00
Marc Mutz
ca22a02296 QTouchDevicePrivate: deal in const QTouchDevice*s
Avoids the copying of the contents when returning devices().

Remove an unneeded #include (already includes by public
header; unneeded there, too, but leaving for SC purposes).

Change-Id: Ifa9a3dc2c7fada01fb624527dd4d16d0cb32a658
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-12 07:48:19 +00:00
Kai Pastor
c2ea62dd34 QPicturePaintEngine: Avoid slow QPainter::clipRegion
QPainter::clipRegion() is expensive especially for certain clip paths.
QPainter::clipBoundingRect() does not promise to return an exact (tight)
bound but delivers the desired result quickly. In addition, this avoids
discretization.

Change-Id: Ib35406edc12fb8206ca978bc140a7c5e21279ca2
Task-number: QTBUG-46578
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-12 07:28:46 +00:00
Alan Alpert
eb9f2e304f Version transitionType as a new property
It is exposed in the QtQml.StateMachine import, but note that the metaobject
version is just incremented (no need to match QtQml.StateMachine, which
is in a different module).

Change-Id: I50773d9dec5252aa93846b7e5f743958ee838023
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-11 16:14:14 +00:00
Ivan Komissarov
9a029c9de4 Fix sizes QStorageInfo returns for invalid drives
Zero is a legitimate size to be returned by bytesFree/bytesAvailable
functions, so change those functions to return some 'invalid' size
in case of an invalid drive.
This is also consistent with the original version from the Qt Systems
framework.

[ChangeLog][QtCore][QStorageInfo] Fixed sizes returned for invalid drives.

Task-number: QTBUG-45724
Change-Id: I312fba521fdf8d52d7a0ac0e46cacca625775e80
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-11 16:13:49 +00:00
Sérgio Martins
552fba2386 core: Add several QList::reserve() calls.
Reduces reallocations.

Change-Id: Ib63539fb690a80245d8fe81ff8468e79ffa8e57c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-11 13:36:15 +00:00