Commit Graph

5687 Commits

Author SHA1 Message Date
Tor Arne Vestbø
a79dd87f3f Add lancelot test for Emoji text rendering / color glyphs
Change-Id: Id69c28ec49be660e40beaf37bad9ac0d4ce0662d
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-06-25 16:53:50 +00:00
Daiwei Li
db377a4202 QSortFilterProxyModel: Keep invalid index updated on source model sort
If we have a filter applied that removes all entries, the source
model is sorted, and then we remove the filter, QSortFilterProxyModel
never emits rowsInserted. This is because it doesn't have the correct
source mapping and doesn't update when the filter is removed.

Change-Id: I447b2d150e509b128d27f4dabc4e081ca4ef037f
Task-number: QTBUG-46282
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-25 00:46:48 +00:00
Christian Kandeler
ec8c1dcf14 Make QDir::relativeFilePath() return "." for a path to itself.
The rationale being that the empty string is not a valid path component.

[ChangeLog][QtCore][QDir] QDir::relativeFilePath() now returns "."
instead of an empty string if the given path is the same as the
directory.

Change-Id: Ibcf31904b2ae5edf5639d4c2e5ba234365d347fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-24 15:43:58 +00:00
Marc Mutz
5b6fd71d3a tst_qzip: remove unused init()/cleanup() functions
Change-Id: I3502e8e20a4496051554dc6fb92ea9bd347cc0f7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-24 12:57:20 +00:00
Alex Trotsenko
19e63a207f Replace QVERIFY with QCOMPARE in QRingBuffer autotest
Gives more information to user in case of failure. Also, fix the
order of parameters for some QCOMPARE's.

Change-Id: I3ea91f9602d4d32ac79027b6093caea749633c01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-23 05:59:13 +00:00
Oliver Wolff
bf24838c33 Use qthread_win.cpp for WinRT as well
Since of Windows (Phone) 8.1 most of the desktop's thread functionality
is also available, so we might be able to share the code and get rid of
the extra implementation for WinRT.

Task-number: QTBUG-43837
Change-Id: I0ce907cd94899834527f88c70e1e395bafdb14b3
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-06-23 05:47:14 +00:00
Laszlo Agocs
d40647922b Revert "windows: Disable D3D9/11 with ANGLE in VMs"
This reverts commit a6000e2b66.

Temporarily remove this to unblock the qtdeclarative dev CI.

While Windows 8 VMs are fixed by this patch, Windows 7 has different
problems.

Change-Id: I45ef064ed953cc4b7bbf19657300d4fc43d82452
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-23 04:08:41 +00:00
Eirik Aavitsland
03fd8fa463 Further tune curveThreshold setting based on strokeWidth
ad9698713f reduced the curvethreshold
for wide lines, to fix QTBUG-46151. But as a side effect, the
threshold was increased for lines of widths >=0 and <4.  This commit
fixes that, and also adds a lance test for the issue in QTBUG-46151.

Change-Id: I52507db622435fe1d2646640cb0bd9cd8222e453
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-22 08:19:57 +00:00
Friedemann Kleint
56aad2ad60 Fix global coordinate mapping for child widgets in QGraphicsView.
Move the code path handling widgets embedded in QGraphicsProxyWidget
into the loop moving up the parent hierarchy.

Add child widget to test.

Task-number: QTBUG-41135
Change-Id: Ibd86413faaa927145a85a2f5864f162979135053
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-21 00:17:41 +00:00
Simon Hausmann
55655abfaf Insignifify qfileinfo on Windows, like QDir
Change-Id: I46595b2802321fa799fd6b0e91ab2cbcbb0193f5
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:14 +00:00
Simon Hausmann
e817ab43c2 Extend flakeyness of tst_QDBusAbstractAdaptor::overloadedSignalEmission(int)
This isn't specific to an Ubuntu version, unfortunately. It also fails
on OpenSuSE occasionally and other Ubuntu versions.

Change-Id: I6a1ca55a198270f1a1e8a9916e9f768762211550
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:10 +00:00
Simon Hausmann
fd9cf9e800 Blacklist flakey tst_QTimeLine::duration test on Windows
Change-Id: Ib9f901da5675a6eb86b90c5137afb66245c395a4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:06 +00:00
Simon Hausmann
ba9bbf596f Improve debug output of tst_QTimeLine::frameRate()
When the test fails, show the actual signals spy count.

Change-Id: Id7312bfbfb6531404a9df73234031f13295c80ea
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:02 +00:00
Simon Hausmann
23cb449885 Extend tst_QPauseAnimation::pauseAndPropertyAnimations blacklist
Unfortunately it's flakey all over ;(

Change-Id: I1395af8a3186b3bc65cd79a60ae434dd9689d6e5
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:58 +00:00
Simon Hausmann
c2c9751c55 Blacklist tst_QPropertyAnimation::startBackwardWithoutEndValue on Windows
It's flakey with 'current > 42' sometimes succeeding and sometimes failing.

Change-Id: I86f52b0d0cecd345ed6c5852c822d12eae6acb26
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:54 +00:00
Simon Hausmann
88c98f38fe Extend the scope of QTBUG-30943
The failure of this test is not architecture specific but rather
Windows specific. It is failing on either type of Windows machine at random
intervals.

Change-Id: Ie3ab1d868053b22ee5b0d965a8cd6b923985b019
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:43 +00:00
Simon Hausmann
bc5581f228 Blacklist socks bind test on Windows
The test is very flakey.

Change-Id: I6cb7ee7989169d077104883a02bb9240bafabe38
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:39 +00:00
Simon Hausmann
7a04670e53 Blacklist tryAcquireWithTimeout
All variants of the tests are timing out randomly on all platforms :(

Change-Id: I9244602a8d06fd07d3cc99b2fb8fdf6e07e92cf2
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:35 +00:00
Simon Hausmann
b373d183de Insignifify qdiriterator test
Crashes on Windows in release builds :(

Change-Id: I6802af510046de414ba5b6c6fb4c4c2c90703a3d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:31 +00:00
Thiago Macieira
94e364464e Autotest: make the test pass with the Intel compiler
The Intel compiler defaults to "fast math" mode, which is why those
tests had been failing. So for the test that is trying to check whether
we conform to IEEE strict requirements, turn on strict requirements.

Change-Id: I02f8426b1c8e4241ac10ffff13e8efa224f313b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-19 23:22:34 +00:00
Thiago Macieira
b2be272d35 Make QMetaObject::Connection check its state deeply
Since Connection can be copied, one copy could be used for
disconnecting, but the other's d_ptr wouldn't get updated and would
continue to report as still connected.

This patch fixes that by making it check the internal state. That is
only done after d_ptr is already known to be non-null. Unfortunately,
that is the common path:

  if (connect(sender, &Sender::signal, [] {}))

will call an out-of-line function. I don't see a way out.

Task-number: QTBUG-46213
Change-Id: I66a35ce5f88941f29aa6ffff13dfb45dca68a350
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-19 23:22:33 +00:00
Thiago Macieira
54589f2932 Autotest: Check where global event filters get run
Global (application-level) event filters are supposed to be run only in
the main thread, so ensure that it is the case.

Change-Id: I27eaacb532114dd188c4ffff13d5a17d991b8bd2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-19 23:22:30 +00:00
Laszlo Agocs
a6000e2b66 windows: Disable D3D9/11 with ANGLE in VMs
By adding support for the driver description, we can detect if
we are in VMware. In this case D3D9 and 11 get disabled, so only
the software-based options are in use.

This allows running autotests like tst_qopengl, tst_qopenglwidget,
tst_qgl, etc. in the Qt CI system. There OpenGL 2.x is not available,
so ANGLE is the only option. D3D11 is not an option, so it picks D3D9
by default. However, this results in mystic failures. The stable solution
seems to be to use WARP. This can be achieved by setting disable_d3d9 in
the built-in GPU blacklist.

Change-Id: I937c4b3fa82fc1a2d524b4eb712732722df2070c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-19 17:52:19 +00:00
Marc Mutz
fedb442db3 QCommandLineOption: optimize ctors
...by moving common code into the Private ctor,
and catering for C++11 move semantics a bit.

Saves ~1.5KiB in text size on Linux GCC 4.9 C++11 release
builds.

Change-Id: I52ed7e47f76b69500a871844c0920e27fe51a127
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 16:29:50 +00:00
Marc Mutz
24ef5d2263 QStringRef: add truncate()
Missing part of QString API.

[ChangeLog][QtCore][QStringRef] Added truncate(int).

Change-Id: I49e218daf8f47fcd3dad131155e0abc8e2a133e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 05:41:41 +00:00
Marc Mutz
302cc32dee QMap: add const equal_range() overload
... to prevent detaching.

[ChangeLog][QtCore][QMap] Added const equal_range() overload.

Change-Id: I4b39abb8ad41ba6eaa8f9a9a74ed74ed10337dd3
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 05:41:33 +00:00
Marc Mutz
6f530fe4d6 QVector: add move(int,int) for QList compat
Change-Id: I67948621313f2e7c69abe7ef95ee82ca64c6512a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-18 19:58:58 +00:00
Friedemann Kleint
c0eafb9d75 QMenu/QToolBar: Add overloads of addAction() using Qt 5 signals and slots.
Add documentation dummies and templates, add tests verifying
compilation.

Change-Id: Ide336b28bc069cfd17848ce3a17fd428e36ed65b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-18 14:42:24 +00:00
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
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
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
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
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
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
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
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
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
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
Friedemann Kleint
56d62345ad Fix less-than comparison for QStandardItem and QSortFilterProxyModel with invalid data.
Previously, QStandardItem::operator<() returned true when both
items had invalid data. With MSVC in debug mode (checked
iterators/STL), this triggered an assert in
tst_QStandardItem::sortChildren() since that verifies
that !(b < a) when a < b:

Debug Assertion Failed!
Line: 3006
Expression: invalid operator<

Introduce a stable sort order for invalid items such that
other items are always less than invalid items and comparing
invalid items returns false (indicating equivalence).

Change-Id: Ica0f0d9f001c86973b1941dbcc1faf282e4c47df
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-11 13:29:23 +00:00
Giuseppe D'Angelo
92cda94742 QSslSocket: move default cipher, EC and default CA APIs to QSslConfiguration
QSslConfiguration is better suited for these APIs. The ones
in QSslSocket that already have a counterpart have been deprecated.

[ChangeLog][QtNetwork][SSL/TLS Support] Most of the QSslSocket
functions to deal with ciphersuites, certification authorities
as well as elliptic curves have been deprecated in favor of the
corresponding counterparts in QSslConfiguration.

Task-number: QTBUG-46558
Change-Id: I1de03379efcbcab931c20e876e252769fe4279e0
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2015-06-11 04:18:37 +00:00
Friedemann Kleint
898ce1dcf5 networkselftest: Fix handling of the smbclient process.
When the server could not be reached, the test previously,
produced:

FAIL!  : tst_NetworkSelfTest::smbServer() 'smbclient.waitForFinished(5000)' returned FALSE. ()
-   Loc: [tst_networkselftest.cpp(992)]
QWARN  : tst_NetworkSelfTest::smbServer() QProcess: Destroyed while process ("smbclient") is still running.

Fix this by:
- Using QStandardPaths::findExecutable to locate the binary instead
  of test-wise starting it.
- Add a function to ensure process termination.
- Pass a timeout argument to smbclient and pass an interval
  depending on it to waitForFinished(), which should prevent
  having to kill the process in most cases.
- Add proper error message

Change-Id: I1cbc76ca69aec7d1e0e880685bed54b0ba7f21c7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-10 12:50:12 +00:00
Friedemann Kleint
4fe332f543 Fix leaking of link in tst_QFileInfo::canonicalFilePath().
Give the link a name containing time stamp and ensure
it is deleted.

Change-Id: I846c58095acbcd92e7daccfd43a69dd97e95e7b0
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-10 10:06:17 +00:00
Friedemann Kleint
bf440c18bb Fix return value of QWindowsFileSystemWatcherEngine::removePaths().
Previously, the path was removed from list returned (indicating failure
to remove) only when the thread's list was empty
(last file in directory). Move the statement up so that removal
happens when it is found in thread's list.

Task-number: QTBUG-46449
Change-Id: Ib79199c731f79357b0e5c17636254fbeb3a754a0
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-06-09 09:50:35 +00:00
Jake Petroules
d0d0ee4ed7 Fix build on 32-bit OS X.
Change-Id: I5f01cb2a5a34a7a2a0c8f0571d50698bd46be733
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-06-09 08:51:10 +00:00
Dmitry Shachnev
657a8cf5be Remove exec bits from files that should not be executable
Change-Id: I66f49c6db82eadc3b11cc9b1cf01375e9596a8e6
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2015-06-07 22:50:19 +00:00
Friedemann Kleint
eb926dc31f QSwipeGestureRecognizer: Allow for small direction changes.
When trying to do a straight right/left/up/down swipe, a minimal
change in the other direction caused to the gesture to be canceled.
Introduce a threshold for checking such to prevent this.

Task-number: QTBUG-46195
Change-Id: I3e199f2ec0c81d23a16073b1f5b8fff004958239
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-06-07 20:10:12 +00:00
Lars Knoll
19ed646bce Make the test pass on high res mac displays
Change-Id: I05f156faae85abe11edc954dd358ddfcfd320c74
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-06 12:01:30 +00:00
Lars Knoll
83eb09d591 Wait for the window being active before sending it events
Change-Id: I2f5d6e37e630d70c4ba3ae81e807a89c447c8b26
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-06 12:01:25 +00:00
Lars Knoll
3658b62781 Fix the autotest on Mac
Don't hit the scrollbar with the mouse click

Change-Id: Ie82d8c5c058df9a482e7d5de2fe40681572f19ad
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-06 12:01:16 +00:00
Lars Knoll
73cc3db4d5 Fix qgraphicswidget::initStyleOption autotest
make sure it'll work with the new mouse handling as well.

Change-Id: Ia2d567e618b77b0fa3532ee6c335cbdf5e496241
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-06 12:00:52 +00:00
Lars Knoll
71388c37d2 Clean up the qgraphicsscene autotest
Change-Id: I8950a3eb9792dff90ed64cd3bf1d572745b05886
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-06 12:00:32 +00:00
Oswald Buddenhagen
d32f47b703 fix usage of wince scope
Fix style issues along the way.

Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-05 10:29:10 +00:00
Simon Hausmann
80bc743406 Fix tst_qglobalstatic on OS X
OS X has an unreasonably low default for the maximum number of open
file descriptors (256). The unit test creates about 200 threads and each
thread in Qt creates at least two file descriptors (pipe), so the test
cannot execute.

Change-Id: I656367bca6d0a40fb1edb8c72914304db0f429ac
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-04 05:56:16 +00:00
Allan Sandfeld Jensen
f04ed82ca2 Font definitions with different style names are not equal
Since we added font matching by style name, the style name is not just
a derived property and should not be ignored in comparisons.

The QFontDef::exactMatch comparison is left unchanged, since it tests
if a loaded font matches a requested one.

Task-number: QTBUG-30851
Change-Id: I4187c5b993815001f35bcf24dc449059bfdcba6f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-03 14:00:07 +00:00
Allan Sandfeld Jensen
8f760808e0 Fix premul conversion from ARGB32 to A2RGB30 formats.
When a premultiplied alpha changes value because it is rounded to fewer
bits the premultiplied colors may need to be recalculated with the new
value. Otherwise the color will both be wrong and potentially invalid.

Change-Id: I9ec74a22aac73cd7ffab04e180cf2bf35bb4c315
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-03 12:01:26 +00:00
Simon Hausmann
e2f66f9215 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/corelib/global/qnamespace.qdoc
	src/corelib/io/qwindowspipereader.cpp
	src/corelib/io/qwindowspipereader_p.h
	src/corelib/statemachine/qstatemachine.cpp
	src/corelib/statemachine/qstatemachine_p.h
	src/plugins/platforms/xcb/qxcbconnection.h
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/tools/qmake/tst_qmake.cpp
	tests/manual/touch/main.cpp

Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
2015-06-03 10:23:56 +02:00
Simon Hausmann
21674735cc Rename QTextStream::readLine(QString *, qint64) into readLineInto
As discussed on the development mailing list, the new overload is ambiguous
and breaks source compatibility. Therefore this function that is new in 5.5
shall be called readLineInto.

Change-Id: I2aecb8441af4edb72f16d0bc6dabf10cdabf32e2
Reviewed-by: Jan Kundrát <jkt@kde.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-03 04:27:22 +00:00
Friedemann Kleint
cd0bed6d71 Polish and stabilize tst_qtooltip.
- Implement init() and cleanup() to verify that
  no top level widgets are leaked.
- Position widget in tst_QToolTip::task183679() and set
  window title.
- Remove hardcoded wait in tst_QToolTip::whatsThis()
  and use a find function within QTRY_VERIFY().
- Rearrange and clean code a bit.

Change-Id: I0b1ad88444fc9441c1071a2527f75de1f68ea9e5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-02 18:51:25 +00:00
Friedemann Kleint
6fba3c1904 Stabilize tst_qtouchevent.
- Use QTRY_COMPARE() in touchBeginWithGraphicsWidget.
- Change raw event translation tests to wait for the
  window to become active to avoid WM positioning issues.
- Blacklist the raw event translation tests on Linux.

Task-number: QTBUG-46266
Change-Id: I73aae375ee279a518a2a083d0ce8919cce474cb3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-01 13:39:13 +00:00
Marc Mutz
87d57d1994 Fix users of QTextLayout::additionalFormats to use the new API
QTextLayout::additionalFormats setters and getters using QList<FormatRange> have
been deprecated; port to the QVector versions.

Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp
to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find
it otherwise.

Change-Id: Ibab6589df057f02377d895079b56395859e3401e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-05-30 10:56:24 +00:00
Olivier Goffart
71c85c554a moc: Fix crash parsing invalid macro invocation
When invoking a macro with less argument than it expect, we would
crash trying to access the vector of arguments from the invocation
as we are trying to substitute an argument.

(Note that we do not show an error in case of argument mismatch
because ithat might happen parsing valid code as moc's c++ parser
is not 100% accurate (that was QTBUG-29331))

Task-number: QTBUG-46210
Change-Id: I3f08d7f5049e593a5bdc02a594ea63cadf66e7a4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-05-30 08:37:11 +00:00
Sérgio Martins
9eff0dd19d QSet: Introduce intersects().
The pattern "mySet.intersect(other).isEmpty()" has been spotted in
the wild and in Qt codebase. intersects() is much cheaper because it
bails out as soon as we find one common item and doesn't do any
allocations.

[ChangeLog][QtCore][QSet] Added intersects().

Change-Id: I44a350dc4cdb9deb835a23eee99fc99d6ca24c82
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-05-30 07:15:24 +00:00
Friedemann Kleint
0c5befa129 Reanimate test gui/kernel/qtouchevent/tst_qtouchevent.
Add CONFIG += testcase to the .pro file which was missing.
The test thus was never executed by make check and left to
rot.

Fix up code:
- Remove module includes.
- Introduce explicit constructors taking parent object
  for helper classes, removing calls to setParent().
- Ensure test does not leak objects by converting pointers
  to stack variables or introducing QScopedPointer, verify
  by checking for an empty window list in cleanup().
- Simplify code by removing unneeded variables.
- Split up conditions in QVERIFY().

Fix tests:
- Show windows were required when events are sent to
  QWidget::windowHandle().
- Invert the conditions checking whether touch events are
  accepted by widgets since widgets no longer accept them
  by defaults in Qt 5 after
  e50416066c.
- XFAIL multiPointRawEventTranslationOnTouchPad()
  which started to fail at some point in Qt 5.
- Mark as insignificant on OS X due to crash.

Task-number: QTBUG-46266
Change-Id: I6676d021afb015411a24d97d9b8f7c327d4d3c3f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-29 16:36:48 +00:00
Friedemann Kleint
4964c89540 tst_QDockWidget::restoreDockWidget: Add QSKIP for XCB.
The positioning test has been observed to fail on X11.

Change-Id: I58727126a8742de93ec203e9992a9ae1b454f731
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-29 15:20:00 +00:00
Tor Arne Vestbø
5471413522 Add shared implementation of a NSAutoreleasePool wrapper to qglobal
We have at least 5 different (but equal) implementations of a wrapper
in Qt, and some code uses explicit NSAutoreleasePools. Having a shared
implementation lets us clean up things a bit and makes it easier to
reason about which pools are actually needed.

Change-Id: I2fd8eefc3ae7308595ef9899b7820206268362a5
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-27 18:45:29 +00:00
Timur Pocheptsov
5449589b7c tst_QApplication - quitOnLastWindowClosed (fix for OS X)
Two (?) tests can fail: what they actually try to test is that our application
quits on the second single shot timer (2 s. timeout) and not on the first one
(timeout 1 s.) - on the first timeout we either ignore event, or we still have another
window and should not quit yet, on the second timeout we actually do quit the app.
The test checks this in a quite fragile way, counting the number of timeouts for the third  100 ms
timer. It looks like on OS X (VM-only) there is some delay (~500-600 ms) before we receive the
first timeout so the count is always 14 or less, making the test to fail.

Change-Id: I9e8728e6c956025d91528f4195982767a5d3d320
Task-number: QTBUG-46164
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-05-27 15:26:27 +00:00
Friedemann Kleint
9749ddeb4b Remove test other/baselineexample.
baselineexample.pro is missing CONFIG += testcase, so,
make check succeeds without doing anything. The test seems
to connect to some network server to retrieve baseline images,
but that infrastructure apparently no longer exists.

Change-Id: I98f4fe5ef8a508fda90e408df2781a944eb99a60
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-27 14:11:22 +00:00
Joerg Bornemann
42b7a7c609 Fix crash due to QTreeView accessing deleted model indexes.
QTreeViewPrivate::updateScrollBars depends on a correctly set up
viewItems vector. If a delayed layout is pending, we must call
QTreeViewPrivate::executePostedLayout before accessing any stored model
indices.

Task-number: QTBUG-45697
Change-Id: I55fcbaf81f225b26181c2cf739283740b85dd16a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-05-27 14:04:41 +00:00
Olivier Goffart
02f6b21bbc QMetaType: Fix compilation with non default constructible Q_GADGET
Do not try to automatically register the meta type for Q_GADGET that
are not default constructible.
This fixes a source incompatibility in the function pointer syntax
of QObject::connect when such types are used as an argument of a signal.

Task-number: QTBUG-45721
Change-Id: I3065f6d57bc1f37e16988d2dee99118de250ca56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-27 10:51:10 +00:00
Giuseppe D'Angelo
d1de6c521e QVector: add const first/last getters
Convenience to avoid annoying detaching (instead of using at()),
especially on temporary vectors (returned by functions or so).

[ChangeLog][QtCore][QVector] Added the convenience constFirst
and constLast functions.

Change-Id: If61b1f0096f6a7a1c9074340e237cc2376ce3d18
Task-number: QTBUG-46026
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-05-26 15:21:21 +00:00
Caroline Chao
a8dda3b8b0 Tests: Use blacklist for failing tst_qwidget tests
Remove the insignificant_tests CONFIG option in favor of a BLACKLIST
file. The tests blacklisted have been found using CI builds logs.

Change-Id: Iffc9043654a9dcd97d55e262011c8daff6f4e60f
Task-number: QTBUG-25300
Task-number: QTBUG-45502
Task-number: QTBUG-46325
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-05-26 11:59:02 +00:00
Joerg Bornemann
80c8d324b3 take process name into account for QLockFile's pid clash resolution
To cover the situation that the process ID got reused, the current
process name is compared to the name of the process that corresponds
to the process ID from the lock file.
If the process names differ, the lock file is considered stale.

[ChangeLog][QtCore][QLockFile] Detection of stale lock files got more
robust and takes the name of the process that belongs to the stored
PID into account.

Task-number: QTBUG-45497
Change-Id: Ic3c0d7e066435451203e77b9b9ce2d70bfb9c570
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2015-05-26 11:01:14 +00:00
Alexander Volkov
59cc316620 Allow horizontal scrolling with a mouse wheel for QListView
Convert vertical wheel events to horizontal for two cases of
the items layout when vertical scrolling is impossible:
1) TopToBottom flow with wrapping
2) LeftToRight flow without wrapping

Do it only for pure vertical events to avoid a mess for such
devices as touchpads or Apple Mouse.

[ChangeLog][QtWidgets][Important Behavior Changes] Allow
horizontal scrolling with a vertical mouse wheel for QListView.

Task-number: QTBUG-37007
Change-Id: Ie2525153fa7b443d27ca08cc5f5d4d7ecdb8c183
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-05-26 08:04:57 +00:00
Thiago Macieira
bd1f5b268a Make sure we don't call dbus_connection_can_send_type on too old libdbus
This function was introduced alongside the support for Unix file
descriptors, so it's a good indicator of whether Unix FDs are
supported. Ever since dbus_minimal_p.h, however, DBUS_TYPE_UNIX_FD may
be defined even if the system libs don't support it.

In order to fix this issue, I had to fix what was apparently a merge
conflict resolution mistake and remove the #ifdef around the test. Doing
the latter is a good idea due to moc being unable to find <dbus/dbus.h>.

This was tested with both linked and dynamically-loaded libdbus-1.

Task-number: QTBUG-46199
Change-Id: I66a35ce5f88941f29aa6ffff13dfb4b5438613a3
Reviewed-by: Jani Vähäkangas <jani.vahakangas@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-05-26 07:20:35 +00:00
Olivier Goffart
75af24a2d1 QMetaType: Do not automatically register types that derives from a Q_GADGET
Otherwise the type is registered with the wrong name

Change-Id: I68ec3a05e2528816626e648b46ccc9d70b004866
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-23 15:42:51 +00:00
Lars Knoll
b0992b5998 Fix autotest on xcb and make it significant again
Change-Id: Ia7c0fb715a66b8d865481a73e16dcd0d3bdf4988
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-23 11:38:18 +00:00
Lars Knoll
cf5f961064 stabilize qwidget autotest
These changes are required to make event delivery from
test lib synchronous.

Change-Id: I8f7093a2bfe01dfa1b0315620d672e7346a7a23a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-23 11:38:10 +00:00
Friedemann Kleint
06de0da1e8 Make warnings of QIODevice more verbose.
Include class name, object name and file name when available.
For the bug in question:

QIODevice::read: device not open

becomes

QIODevice::read (QTcpSocket, "QFtpDTP Passive state socket"): device not open

Adding a static function also makes it easier to set a breakpoint
and find the culprit.

Task-number: QTBUG-46112
Change-Id: Ic181d8ab292912d1acbcc3cb84d9679fe4842ca0
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-05-23 08:59:20 +00:00
Lars Knoll
35a161212c Fix blacklisting
The test fails on all ubuntu versions, not only 14.04 as far
as I can tell.

Change-Id: I1e204f68bbb791eef25338f0ed007942a2eb22ff
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-22 17:51:37 +00:00
Lars Knoll
c200ef633e Fix table view test
The resizeColumnsToContents test would fail on some machines, as the
requested 40 pixels where to small to accommodate the header size hint
as well. Raising it to 60 pixels helps make the test pass.

Change-Id: I2a5026fd18425e236849a1cef25ba8d899c7ae5a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-22 17:51:31 +00:00
Simon Hausmann
6a72afa5f7 Blacklist tst_qwindow tests that are failing on Ubuntu 14.04
This should allow us to make the rest of 14.04 enforcing

Change-Id: I37f6751e8b966b047d1bd2e49ba9482e5846acb1
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2015-05-22 14:24:32 +00:00
Friedemann Kleint
9d9450f5f9 Add CONFIG += testcase to test qglobalstatic.
Otherwise, make check does nothing, always succeeding.

Change-Id: I0fe04697e02ab0f33cd9aebb550777e200c70804
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-22 04:37:52 +00:00
Oswald Buddenhagen
8175e31bda remove now redundant tests
the functionality is now covered by the qmakelib test.

Change-Id: Id627f573fb247ff3b86558509e27b6a9862c1a59
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-20 18:11:37 +00:00
Oswald Buddenhagen
5ddc16b5df add qmake evaluator test
Change-Id: I31b95daede5edef245dd1ba447f2937a0db34232
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-20 18:11:34 +00:00
Oswald Buddenhagen
ef50e244cd split parser test initialization
the idea was to speed up optimized msvc compilation, but it didn't help.
still, it's better structured that way.

Change-Id: I4b2108d02a47ef8ef704b0b542b0f281bff20165
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-20 18:11:32 +00:00
Oswald Buddenhagen
48c38aae10 move parser test to a separate file
for better structure.

Change-Id: I16bd1ca245640e92ffe167241a5a565e7a550e1d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-20 18:11:30 +00:00
Oswald Buddenhagen
f37381e292 add autotest for ProString
also adds documentation, which is kind of a sanity test. ehm.

Change-Id: I6b520e8b505a2bfbb1e376fa72be0f140227a3a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-20 18:11:08 +00:00
Oswald Buddenhagen
a3fac53864 add parser tests for use of 'else' after bad conditionals
Change-Id: I9885f629a2f6511574eebd81896a1d9f258e55cb
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-05-20 18:11:05 +00:00
Oswald Buddenhagen
79de60f38b silence MSVC warnings about using TS() without parameters
Change-Id: I23264dcabc02b89441fa47c890fc662e9a41f7ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-20 18:11:03 +00:00
Thiago Macieira
9269dcc8ed Fix compilation of QContiguousCache::operator=
freeData() takes a Data*, not a QContiguousCacheData*.

Task-number: QTBUG-45783
Change-Id: I96d7ac38dac24b418138ffff13d7fdf09b1d6b07
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-05-20 17:23:33 +00:00
Alex Trotsenko
e227b8ecf6 Deinline QRingBuffer class
Reduce the size of .text section in QtCore by 4.5KB and in QtNetwork
by 26.5KB.

Change-Id: If7998776166b9681c1e4b24c51d40444aa996d7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-05-20 13:49:00 +00:00
Erik Verbruggen
67d255f183 QStateMachine: empty the whole internal queue before external queue
If the internal queue contained multiple events, but the first one did
not select any transitions, the external event queue would be checked
before the remaining events in the internal queue.

Change-Id: I1a7f49afdefaaf2b4330bf13b079b61344385ea0
Task-number: QTBUG-46059
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-05-19 08:03:46 +00:00
Tor Arne Vestbø
e124ad54b8 Allow RESOURCES to contain standalone files and collections of files
Standalone files are added by using RESOURCES += file.txt, while
collections of files are defined as collection.files = f1.txt f2.txt
and then added using RESOURCES += collection. For collections a prefix
can also be set using collection.prefix = /foo. The standalone files
are not prefixed.

Change-Id: I8236808238414da05e744f799a1bb15a72f4a46f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-05-18 15:49:56 +00:00
Olivier Goffart
35a125971c Fix QtPrivate::IsQEnumHelper<void>
Change-Id: I1633ef128212a6b99b66129f13e0b4d5ea46644d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-17 09:13:18 +00:00
Timur Pocheptsov
1485c2f3fa tst_QDialog::snapToDefaultButton - tune the test for OS X
QCursor::setPos with Cocoa integration is calling CGEventPost. Some time is required
before the cursor position is really set, so we can not immediately call QCOMPARE.

Change-Id: I83a4c13f06ec151a4b9ab18c83de1eb5247ea9cc
Task-number: QTBUG-45553
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
2015-05-15 09:39:41 +00:00
Caroline Chao
1842322b2b Tests: Remove EXPECT_FAIL in tst_QWidget::widgetAt()
The test is marked as XPASS in CI. This change follow 201bf9e673.

Change-Id: I0938b1417f792aa88fc1b40c08e7cd810e7d22f7
Task-number: QTBUG-22326
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-15 09:33:40 +00:00
Gabriel de Dietrich
629f5a46d5 moc: Generate qt_static_metacall for creatable-only gadgets
Prior to this, moc would not generate the function unless the
gadget class had a property or a non-constructor invokable.

Change-Id: Ic020ea5f8f59702f5e9e194a46e26850e53e5cfe
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-05-13 12:08:57 +00:00
Gabriel de Dietrich
d6efc6b543 moc: Fix type for gadget's CreateInstance metacall
An error similar to the one below would be emitted
by the compiler on the moc generated file:

error: assigning to 'QObject *' from incompatible type 'Gadget *'
       if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break;

Change-Id: I75ae7bd6c46d20db2d47a80eaa08aae302d7d6c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-05-13 12:08:54 +00:00
Caroline Chao
78a1090821 Tests: Remove tst_QHostInfo::abortHostLookupInDifferentThread() test
This test has been initially blacklisted. However it is racy by design
and cannot be fixed. Removing it.

Change-Id: I6c386a12e54d8a382f17c4fc033428f56eb03f02
Task-number: QTBUG-23837
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-05-13 11:21:14 +00:00
Frederik Gladhorn
ec93ea4a6f Fix building tst_QPluginLoader on OS X, non-devel builds
QMachOParser is defined in the private header that only gets included in
developer-builds. Thus ifdef its usage out, not just the header
inclusion.

Change-Id: I1e0059787be6eb70bd1661c7814e69eee7c5b2ee
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-13 06:15:28 +00:00
Allan Sandfeld Jensen
ba323b04cd Optionally apply orientation on QImage read
Make it possible to read images with EXIF orientation automatically
applied. This was originally implemented without opt-out in Qt 5.4, but
reverted. Here it is implemented as opt-in for JPEG, and opt-out for TIFF
to keep behavioral consistency.

The EXIF support for JPEG was written by Rainer Keller.

[ChangeLog][QtGui][Image plugins] An option has been added to
QImageReader to enable automatic application of EXIF orientation.
This behavior was default in Qt 5.4.1, but reverted in Qt 5.4.2.

Task-number: QTBUG-37946
Task-number: QTBUG-43563
Task-number: QTBUG-45552
Task-number: QTBUG-45865
Change-Id: Iaafd2519b63ede66ecc1f8aa4c7118081312b8f5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-12 09:25:11 +00:00
Christoph Schleifenbaum
52c122e616 Improve QListView scroll bar calculation.
When both scroll bar's policies are set to ScrollBarAsNeeded, make sure
the scroll bars are shown if needed and not show if not. Even the corner
case, where one scroll bar's visibility depends on the other, is handled
properly.

Task-number: QTBUG-45470
Change-Id: I11d6ccf7c0b51644a5ce2d5c3fc59e2e4812755d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2015-05-10 07:45:23 +00:00
David Faure
cca5cce205 Use ItemIsUserTristate instead of ItemIsTristate in table & list tests.
ItemIsTristate only makes sense in tree widgets, where it triggers the
auto-tristate behavior between parents and children.

Change-Id: Idfa8bb5d0b9c63fe450115fb58d088929e11c7ff
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-05-09 10:01:41 +00:00
David Faure
f1bfc4266b Don't overwrite applicationName if already set.
My commit 6c973dee2c broke the case where setApplicationName
is called before the QCoreApplication constructor.
Fixed and added autotest.

Task-number: QTBUG-45283
Change-Id: If7bdb0d82be50b50a95a04027f5f9d7143c1a7ac
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-05-09 10:01:33 +00:00
Giuseppe D'Angelo
1ac1ae05f5 QDialogButtonBox: prevent crashes on deletions in slots
As usual, user code connected to signals emitted from Qt may destroy
an object's internal status while a signal is being emitted.

Guard a bit QDialogButtonBox signal emissions to prevent
crashes in case the button or a dialog get deleted from a slot
connected to clicked(). Also, be sure to emit the corresponding
accepted/rejected/etc. signal.

Change-Id: I7b1888070a8f2f56aa60923a17f90fb5efef145c
Task-number: QTBUG-45835
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-05-09 08:41:23 +00:00
Allan Sandfeld Jensen
1fce111809 Merge remote-tracking branch 'origin/5.4' into merge5.5
Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/io/qnoncontiguousbytedevice_p.h
	src/gui/image/qjpeghandler.cpp
	src/network/access/qhttpthreaddelegate_p.h
	tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
	tests/auto/widgets/widgets/qmenubar/BLACKLIST

Change-Id: I01de8c1c28efcedfd7953d05025f54802dc08ab3
2015-05-08 13:26:44 +02:00
Thiago Macieira
3545ef4121 Autotest: Check if this D-Bus library knows about file descriptors
Because if it doesn't, then calling dbus_type_is_fixed or is_basic may
result in a failed assertion.

 process 16304: arguments to dbus_type_is_fixed() were incorrect,
 assertion "_dbus_type_is_valid (typecode) || typecode ==
 DBUS_TYPE_INVALID" failed in file dbus-signature.c line 345.

Change-Id: Idf715b895bac4d56b4afffff13db2ed71b1516a5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-05-08 09:04:23 +00:00
Caroline Chao
201bf9e673 Tests: Remove EXPECT_FAIL in tst_QWidget::widgetAt()
The test is always marked as XPASS in CI.

Change-Id: I629bdec6f038cd8b6208fc4db61c67a9ea003b2e
Task-number: QTBUG-22326
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-05-08 05:33:28 +00:00
Giuseppe D'Angelo
a34e9ebc1b QLineEdit: show the clear button if it gets enabled after setting a text
We were fetching "lastText" too late, and setting the opacity
of the clear button to 0.

Change-Id: I82c2aea7dab4af4424fb57e12f78d07a0374457e
Task-number: QTBUG-45518
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-07 22:24:25 +00:00
Thiago Macieira
36d6eb721e Require -fPIC instead of just -fPIE for -reduce-relocations
GCC 5 combined with a recent binutils have a new optimization that
allows them to generate copy relocations even in -fPIE code. Clang has
the same functionality when compiling an executable with -flto. We need
to let the compilers know that they cannot use copy relocations, so they
need to use really position-independent code.

Position independent code throughout is not really required. We just
need the compilers to use position-independent access to symbols coming
from the Qt libraries, but there's currently no other way of doing that.

Task-number: QTBUG-45755
Change-Id: I0d4913955e3745b69672ffff13db5df7377398c5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-05-07 19:42:43 +00:00
Allan Sandfeld Jensen
b64e87f2ed Blacklist task256322_highlight on OS X
The test keeps failing. The approach of sending mouse move events is
inherently fragile due to the use of QCursor::setPos and the expectation
that that produces the correct sequence of mouse move events.

Change-Id: I07ec75460b70c27152e8775deffcb77fa9328d0c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-07 19:25:18 +00:00
Erik Verbruggen
eb4bf7df60 QStateMachine: Fix transition ordering.
When there are conflicting transitions, a transition that is nested
deeper (i.e. more specific) has priority. If two transitions have the
same nesting level, the one that comes first in the document order gets
priority.

Before this patch, only the document order was considered.

Change-Id: I58f188c270cabe2c386a783ceef7a0a955105425
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-05-07 15:37:17 +00:00
David Faure
cd90182e67 QStandardItem: add user-tristate and auto-tristate getters/setters
and deprecate isTristate()/setTristate() which isn't specific enough.

This matches the changes to the flags themselves.

Change-Id: I0ba592af340cb81fc9f4d483569844fe8d7510c3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-05-07 09:50:59 +00:00
David Faure
ae8406d82f Deprecate ItemIsTristate in favor of ItemIsAutoTristate.
This makes the behavior much more clear. You can get a tristate checkbox
just by setting the CheckStateRole to PartiallyChecked, no tristate flag needed.

The flag, on the other hand, enables the automatic-tristate behavior in
QTreeViews (and only there), hence the new name for it.

Change-Id: I18d292a8b8294c863eab806f3874d15dfb72556c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-05-07 09:14:18 +00:00
Marc Mutz
87155a8d65 Add qHash(QRegExp) and qHash(QRegularExpression)
QReg*Exp*s can be compared for equality,
so qHash should be overloaded, too.

There was a (poor) private implementation of qHash(QRegExpEngineKey)
already, which has now been replaced with a better one (the old one
didn't take into account all the fields that make up equality,
producing unnecessary collisions).

[ChangeLog][QtCore][QRegExp] Added qHash(QRegExp).
[ChangeLog][QtCore][QRegularExpression] Added qHash(QRegularExpression).

Change-Id: I1d22fbcc0508018a3f94b4c24571b13ba6e07df2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-05-05 13:59:31 +00:00
Caroline Chao
934e14127b Tests: Remove insignificant for tst_QGraphicsProxyWidget
The failing test has been blacklisted in 3ed6f74fb2.

Change-Id: I5a2defd839e2f98690fc8cea9ff18e7503caf0de
Task-number: QTBUG-25294
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-05 12:46:05 +00:00
Caroline Chao
96527f74e2 TestCase: Also check main source path when looking for test data
This is for example useful when looking for a possible BLACKLIST
file while doing a shadow build.

Add autotests for blacklist.

Change-Id: I41d3939d31d21d10187fefcb82604736d911b6ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-05 07:06:52 +00:00
Giuseppe D'Angelo
3287e7a68a QGraphicsWidget: call normal "setParent" when setting a parent
QGraphicsWidgetPrivate::init had a special code path for setting
the item's parent. For some reason that code path caused the
ItemChildAddedChange notification not to be sent to the parent
element, which is wrong. Instead use the "normal" path, which is
what the QGraphicsItem constructor does anyhow.

Change-Id: Iad84cae05d797022a45977d35ca00c80c17c306a
Task-number: QTBUG-45867
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2015-05-05 05:02:51 +00:00
Simon Hausmann
862cceb6d2 Merge "Merge remote-tracking branch 'origin/5.5' into HEAD" into refs/staging/dev 2015-05-04 13:58:47 +00:00
Erik Verbruggen
c07f5b801b QStateMachine: add internal transitions.
The behavior of "external" and "internal" transitions is identical,
except in the case of a transition whose source state is a compound
state and whose target(s) is a descendant of the source. In such a case,
an internal transition will not exit and re-enter its source state,
while an external one will.

[ChangeLog][State machine] Added support for internal transitions.

Change-Id: I9efb1e7368ee52aa2544eb84709a00ae3d5350d3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-05-04 12:49:28 +00:00
Erik Verbruggen
bd15b23987 QStateMachine: cache expensive calculations.
As nothing changes in the state machine when selecting transitions for
events and then calculating the exit- and entry-sets, some calculations
can be cached.

The exit set for a transition was calculated multiple times. First in
removeConflictingTransitions, where the two loops would each calculate
them multiple times. Then secondly in microstep(), which would calculate
the exit set for all transitions.

Transition selection, exit set calculation, and entry set calculation
all calculate the transition domain and effective target states for
transitions.

Change-Id: I217328a73db2f71e371eb5f60a0c7b222303f0ca
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-05-04 12:49:22 +00:00
Valery Kotov
a5890fbcd8 qnetworkreplyfileimpl: set attributes if file was sent
Set status code and status text if file was sent with reply.

Change-Id: Ie6acadc5c1d06538449262ffd8486e8de573b931
Task-number: QTBUG-45581
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-05-04 11:20:40 +00:00
Simon Hausmann
7f8719e663 Merge remote-tracking branch 'origin/5.5' into HEAD
Change-Id: I487a4b7c05687a10c498ac219c31367d4db6fbc0
2015-05-04 13:19:31 +02:00
Friedemann Kleint
315b359bc1 QFileDialog: Stabilize tests.
The init()/cleanup() code in tst_qfiledialog and tst_qfiledialog2
currently differs and fails to clean up the settings file
since it only removes the legacy settings under the Qt group
and instantiates a new QFileDialog while the QSettings class
is still in scope. Also, it has no means of clearing the
setLastVisitedDirectory(), which causes the
tst_QFiledialog::completer() and tst_QFiledialog::history() tests
to interfere, leaving the settings in an invalid state.
tst_qfiledialog2 does not use QStandardPaths::setTestModeEnabled(().

- Ensure the last visited URL is always clean by
  making QFileDialogPrivate::setLastVisitedDirectory()
  static and calling it from init().
- Introduce a cleanupSettingsFile() function to the tests that
  cleans both groups and call it from initTestCase() and cleanup()
  to ensure a clean state.
- Add QStandardPaths::setTestModeEnabled() to tst_qfiledialog2.

Fixes sporadic test fails when executing
tst_QFiledialog::completer() and tst_QFiledialog::history()
in a sequence.

Task-number: QTBUG-45764
Change-Id: I24de3caabf77be067b385d64ff11b7a07fe12b72
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-01 06:03:10 +00:00
Allan Sandfeld Jensen
041cbe4b38 Add missing RGB32 <-> RGB30 convertions
Completes the inplace converters so that we can rely on inplace
conversions to succede as long as the image depth is the same.

Change-Id: Ia1ae34b5de1bc16e87ff5403bdacfcae44a22791
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 19:27:39 +00:00
Allan Sandfeld Jensen
68faf3a9bb Fix QImage format after inplace conversion
Some inplace conversions would not set the requested image format in
the returned image, due to the same conversion being used for several
destination formats.

This patch ensures all inplace conversions return the right format,
and adds testing infrastructure to easily test iterate over all formats
so that they all can be tested.

Change-Id: I68ab17a713ddb2aa8ed6aaf0a0a1ec8bbcb56090
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 15:26:26 +00:00
Allan Sandfeld Jensen
52ddfb36c8 Fix two errors in RGB30 conversions
The one converters from RGB30 was misplaced in the method table, and
the unpremultiplication from A2RGB30 to RGB30 had an underflow mistake
when alpha was 2.

Change-Id: I92c11ede28611a3dbdce72aca1898845c120c209
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 10:00:21 +00:00
Frederik Gladhorn
631eb12dd2 The qpluginloader machtest needs Q_AUTOTEST_EXPORT
Doing a build on OS X without -developer-build fails.

Change-Id: I49c178ab2428177d9dd94f84620595a4bc132244
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-30 06:32:23 +00:00
Rainer Keller
518f886b61 Revert "Rotate images according to Exif orientation"
Due to a behavior change.

This reverts commit 9157087334.
This reverts commit 16c32c6dfb.

Task-number: QTBUG-37946
Task-number: QTBUG-45552
Task-number: QTBUG-43563
Change-Id: Idf8df7d8f22465e8f6b51acb68993ac97208b184
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-29 17:36:43 +00:00
Marko Kangas
0abf5ec7c4 Add support to set text/uri-list mimedata via setData()
Fixed issue that text/uri-list mimedata got from QMimeData::data()
was corrupted after setting it back via QMimeData::setData()

Change-Id: I2377523a9286519402ab9127ed7f3fa66e39a679
Task-number: QTBUG-45486
Reviewed-by: David Faure <david.faure@kdab.com>
2015-04-28 12:46:35 +00:00
Allan Sandfeld Jensen
f15d6c3fa9 Preserve QImage metadata in image transforms
Some QImage methods were not preserving image metadata, or only
preserving some of it. This adds the missing parts and adds a test for
metadata.

Change-Id: Ib5892a23e49dfde5ea26074d3deaa887fa930c6b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 12:42:12 +00:00
Caroline Chao
1576f62eaf Tests: Use blacklist for failing tst_qfilesystemwatcher tests
Remove the insignificant_tests CONFIG option in favor of a BLACKLIST
file. The tests blacklisted have been found using CI builds logs.

Change-Id: I34374ed7269f941c330c65d97fe083c83d3df461
Task-number: QTBUG-33574
Task-number: QTBUG-30943
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-28 12:35:21 +00:00
Simon Hausmann
1b4ce37371 Blacklist task258920_mouseBorder on Mac
The test keeps failing, perfectly when run singly btw. However the approach of
sending mouse move events is inherently fragile due to the use of
QCursor::setPos and the expectation that that produces the correct sequence of
mouse move events.

Change-Id: I12ba1afcfd3fab965b8f93d5def48b435fd2ff33
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2015-04-28 06:11:07 +00:00
Liang Qi
1c8451bdbb Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/tools/qdoc/tree.cpp
	tests/auto/gui/painting/qcolor/tst_qcolor.cpp

Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
2015-04-27 21:36:32 +02:00
Jacek Całusiński
0635b1a69d Moc: test if superclass list is not empty before accessing first()
Accessing QList().first() with an empty superclassList caused assertion
fail. Added check to fix it.

Change-Id: I1aff35e0d267fc0e670beadba1bd196b175a4da8
Co-authored-with: Olivier Goffart <ogoffart@woboq.com>
Task-number: QTBUG-45790
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-27 16:14:17 +00:00
Caroline Chao
411a3490fd Tests: Blacklist tst_QHostInfo::abortHostLookupInDifferentThread
Remove the insignificant_test CONFIG option in favor of a BLACKLIST
file. This test has been found failing on OpenSuse in CI.

Change-Id: Ibc6af3c30277fec7e422e8bbeccd9437de2a61ce
Task-number: QTBUG-23837
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-04-27 11:52:25 +00:00
Friedemann Kleint
4bafef9890 QMainWindow::restoreDockWidget(): Fix positioning of floating docks with native decoration.
Use QWidget::move() to position floating dock widgets.
Add a test for QMainWindow::restoreDockWidget().

Task-number: QTBUG-45780
Change-Id: I945917728a663916e8c225b9d3d2a75fa508d68f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-26 13:15:57 +00:00
Richard J. Moore
00f0a4119c Add the ability to prefer the cipher preferences specified by the server.
Currently the cipher preferred by the client will always be used for SSL
connections. This change makes it so that by default the ciphers
specified by the server will be used (like the Apache SSLHonorCipherOrder
option). This behavior can be disabled using a new SslOption.

[ChangeLog][QtNetwork][QSslSocket] QSslSocket will now default to using
the cipher preferences of the server socket when used as an SSL server.
This can be disabled using the QSslConfiguration.

Change-Id: I2d16d10145cf88a7412f30ef960d87024777de1c
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
2015-04-25 12:10:50 +00:00
Caroline Chao
cf5e3f37f4 Tests: Blacklist task260974_menuItemRectangleForComboBoxPopup
On OS X 10.10. This test in tst_QComboBox is currently failing in CI.

Change-Id: Ie326f79a900c3ae926c7ebe5bb5880dd422cee60
Task-number: QTBUG-45531
Reviewed-by: David Faure <david.faure@kdab.com>
2015-04-24 13:43:06 +00:00
Allan Sandfeld Jensen
71203b1f0e Fix overflow in rgb30 gradient tests
The tests were trying to access one pixel outside of the image.

Change-Id: Ieabdefbbdb76bb736214a0495bec72c881b27d2c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-24 09:03:48 +00:00
Oswald Buddenhagen
3378aa45c2 fix distclean targets
this makes the distclean targets work throughout qt.
the dreaded confclean target is aliased to distclean.

Task-number: QTBUG-8202
Task-number: QTBUG-20566
Change-Id: I7ac8e3b5b0110825dc93e4fa885281db91c6cf83
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-04-23 19:16:57 +00:00
Allan Sandfeld Jensen
f657ecdc5d Fix inplace double mirroring on odd sized images
The QImage inplace mirroring method, failed to handle the middle line
when mirroring both ways (rotate 180). In both other mirroring cases
the middle can be left untouched, but in this case it needs to be
mirrored half way.

To make the logic simpler, double mirroring will now mirror half the
lines instead of half of every line.

Change-Id: Iaa1f1e1c3f7dedfb78891fc93207f6d0c64bcafe
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-23 10:14:48 +00:00
Friedemann Kleint
c3737573ce uic: Delay the setting of QPushButton::default.
For the property to take effect, the button must have its
parent set. This might not be the case when a container like
for example QTabWidget is involved. Move the setting of the
property to the bottom of setupUi.

Task-number: QTBUG-44406
Change-Id: Ic2013865a020986475fa28f2e3805c63d4de8ed0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-04-23 09:59:51 +00:00
Friedemann Kleint
6545404afa Windows: Fix QLockFile hanging when file cannot be created.
Return QLockFile::PermissionError when file does not exist, preventing
the stale file detection logic from triggering.

Add Windows-only autotest trying to create a lock file in
a system folder guarded with checks for elevated processes
and UAC virtualization.

Task-number: QTBUG-45631
Change-Id: I1790f8f925660f6bf1df94c2ced901e6ec57cbb0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-04-23 09:59:43 +00:00
Friedemann Kleint
1f2ce78f16 tst_QFileSystemWatcher: Improve diagnostics.
Add a special signal spy that records the time and path received
to obtain information on what triggered it for the flaky
cases where more than the expected signals were emitted.

Task-number: QTBUG-30943
Change-Id: I67510ce5e8e19b49c0ca41457f8357b720cade76
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-23 09:59:38 +00:00
Allan Sandfeld Jensen
63d5a42b59 Revert "Remove separate SSE4 unpremultiply function"
Could causedSSE4 instructions to be used on non SSE4 machines
in cases when qUnpremultiplywas not inlined.

This reverts commit 964ccc5853.

Change-Id: Ic676ade8f75129e8d37c4d96cbfb2bdb5b794919
Task-number: QTBUG-45741
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-23 09:25:28 +00:00
Caroline Chao
6535912add Tests: Remove tst_QGraphicsIten::sorting from the BLACKLIST file
The test tst_QGraphicsIten::sorting is blacklisted but always passing.

Change-Id: I69bbd4b4bbe227267e16ab5558ddabe7d2c0b1b3
Task-number: QTBUG-41342
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-04-22 10:50:50 +00:00
Caroline Chao
5a3a59b1c1 Tests: Blacklist tst_QGraphicItem::ensureUpdateOnTextItem
On OS X 10.10. This test is currently failing in CI.

Change-Id: I1b3a33b404c915e83c5e4fa0a7af69d1b941d93c
Task-number: QTBUG-41342
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-04-22 10:50:47 +00:00
Friedemann Kleint
3e42eeeec1 Improve tst_uic.
- Make the version regexp a member variable, avoiding repeated
  construction.
- Use QVERIFY2() with error message for opening files.
- On failure, try to locate the standard diff tool and produce
  diff output for comparison, which should make for example
  copyright header changes much easier.

Task-number: QTBUG-44406
Change-Id: Ic759899c1da3394e3eb0cee7b1c722f0945714d3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-04-22 10:23:53 +00:00
Erik Verbruggen
9ff550807d Remove unused private field from test.
Change-Id: I6f991f35a035ed9ff28ff8548b647916db85db39
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2015-04-22 10:16:32 +00:00
Liang Qi
aed5a71683 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/corelib/statemachine/qstatemachine.cpp
	src/corelib/statemachine/qstatemachine_p.h
	src/gui/painting/qdrawhelper.cpp
	src/plugins/platforms/xcb/qxcbnativeinterface.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/plugins/platforms/xcb/qxcbwindow.h
	src/testlib/qtestblacklist.cpp
	src/tools/qdoc/node.cpp
	src/tools/qdoc/node.h
	tests/auto/gui/painting/qcolor/tst_qcolor.cpp

Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
2015-04-22 09:25:54 +02:00
Lars Knoll
d3d10cf23d Improve error handling in qtestlib
Dump a stack trace on Linux if the process crashes. This will give us
much better log output in the new CI system. In addition, create a
watch dog thread, that kills the test if the test function times
out (ie. hangs)

Implementations of the stack trace dumping for Mac and Windows
are still pending.

Change-Id: I65426c5afe290a0a2019b881436a0c278f1cafaf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-21 16:19:09 +00:00
Friedemann Kleint
cba5556953 Skip tst_QFiledialog::directoryEnteredSignal() depending on side bar entry count.
The test relies on having at least 2 entries, which is not always the
case.

Change-Id: Ief812c598409fe829edb930e563740e5f2213580
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-21 11:11:41 +00:00
Marc Mutz
05d1693793 Add qHash(QMatrix) and qHash(QTransform)
QMatrix and QTransform can be compared for equality,
so qHash should be overloaded, too.

[ChangeLog][QtCore][QMatrix] Added qHash(QMatrix).
[ChangeLog][QtCore][QTransform] Added qHash(QTransform).

Change-Id: I1ce925ebe258c9d7e35b68e5ac5c3373f1460c58
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-21 07:28:14 +00:00
Frederik Gladhorn
299350f668 Remove unused function
Change-Id: I2f629ce9a414c822aba20000f36f06a18594c7a3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-04-20 20:07:47 +00:00
Oswald Buddenhagen
4171a98ca5 Merge 5.4 into 5.4.2
Change-Id: Ice194d5e8dcd1003acfc9864620b166699b74a44
2015-04-20 12:25:51 +02:00
Markus Goetz
cff39fba10 QNAM: Fix upload corruptions when server closes connection
This patch fixes several upload corruptions if the server closes the connection
while/before we send data into it. They happen inside multiple places in the HTTP
layer and are explained in the comments.
Corruptions are:
* The upload byte device has an in-flight signal with pending upload data, if
it gets reset (because server closes the connection) then the re-send of the
request was sometimes taking this stale in-flight pending upload data.
* Because some signals were DirectConnection and some were QueuedConnection, there
was a chance that a direct signal overtakes a queued signal. The state machine
then sent data down the socket which was buffered there (and sent later) although
it did not match the current state of the state machine when it was actually sent.
* A socket was seen as being able to have requests sent even though it was not
encrypted yet. This relates to the previous corruption where data is stored inside
the socket's buffer and then sent later.

The included auto test produces all fixed corruptions, I detected no regressions
via the other tests.
This code also adds a bit of sanity checking to protect from possible further
problems.

[ChangeLog][QtNetwork] Fix HTTP(s) upload corruption when server closes connection

Change-Id: I54c883925ec897050941498f139c4b523030432e
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
2015-04-20 08:00:02 +00:00
Nikita Baryshnikov
ad03511256 QDir: fix int overflow
This caused reverse order of session items in qt creator. Introduced
in ba287c55ef.

Change-Id: I5c37ca6a1ef4753b6449eb9e87b4def5ea858677
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-04-20 07:43:58 +00:00
Marc Mutz
adfe9ea1e0 Add qHash(QVector)
QVectors can be compared for equality, so qHash should be overloaded, too.

[ChangeLog][QtCore][QVector] Added qHash(QVector).

Change-Id: I2aacce55d416abf2492631a504a02c6e8fc4ff1c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-20 07:42:03 +00:00
Marc Mutz
f9063758cb Add qHash(QUrlQuery)
QUrlQueries can be compared for equality, so qHash should be overloaded, too.

[ChangeLog][QtCore][QUrlQuery] Added qHash(QUrlQuery).

Change-Id: I626258a938359b49a0cae02012b6cba5ef1fe784
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-20 07:41:56 +00:00
Marc Mutz
5fdc64f566 Add qHash(QList)
QLists can be compared for equality, so qHash should be overloaded, too.

[ChangeLog][QtCore][QList] Added qHash(QList).

Change-Id: I9ad91811f12479764cc17d87192539612ceb0b4c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-20 07:41:44 +00:00
Harald Hvaal
8fb881900c Enable checking for whether the system palette was explicitly set
In order to obey a palette set globally on QApplication, an application
attribute for checking if it's set at all is added.

Task-number: QTBUG-39800
Change-Id: I26b965e6e18e0e1ca4df03cf343b3527df3636b2
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-20 06:39:31 +00:00
Caroline Chao
848f01f9fb Tests: Use blacklist for failing tests in tst_macnativevents
Remove the insignificant_tests CONFIG option in favor of a BLACKLIST
file. The tests blacklisted have been found using CI builds logs.

Change-Id: I1a963bdc24f7657731dc0374a8e2c3cbaa49f126
Task-number: QTBUG-22775
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-04-17 14:07:14 +00:00
Allan Sandfeld Jensen
964ccc5853 Remove separate SSE4 unpremultiply function
Merges the SSE4 specific unpremultiply with the normal version, and
adds a SSE2 fallback. There was no reason to split the two since
compile time options will ensure the right version is inlined.

Also adds short-cut for 0 and 255 values.

Change-Id: Ie5aa262f6964219fd3062d4a498f697cf79a4595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-16 19:24:06 +00:00
Laszlo Agocs
f3fad26bc9 Add matching by GL_VENDOR to QOpenGLConfig
This will be essential on Linux, especially Embedded where PCI IDs are
not that useful.

Change-Id: I2fa8ca07236e8aae203e21fe629d12aab092c7fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-16 16:47:43 +00:00
Alexander Volkov
0c28e1ab7a Fix finding the closest active touch point for the pressed touch point
Currently pressed touch point is added to the list of active touch
points in Gui module. It must be excluded from consideration when
we traverse the list.

Task-number: QTBUG-43255
Change-Id: Idddab093b1f6a79122cf18fad7f43bfc93ce7eea
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-04-16 15:22:36 +00:00
Olivier Goffart
f58e882b75 QLockFile: fix deadlock when the lock file is corrupted
[ChangeLog][QtCore][QLockFile] Fixed a deadlock when the lock file
is corrupted.

Task-number: QTBUG-44771
Change-Id: Ic490b09d70ff1cc1733b64949889a73720b2d0f3
Reviewed-by: David Faure <david.faure@kdab.com>
2015-04-15 21:40:19 +00:00
Allan Sandfeld Jensen
95f694682e Implement radial and conical gradients for rgb64 rendering
Adds the last two missing source types to rgb64 rendering.
Conical and radial gradients. At the same time linear
gradients are moved to a template form to increase code
sharing.

Change-Id: I30fdd0837b0da03e3447683856ebbe4d7f48df6c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-15 19:34:04 +00:00
Allan Sandfeld Jensen
7432c7c08a Cleanup and optimization of qimage smoothscale
Cleaning up smoothscale code. Upscaling is improved using existing
optimized interpolation methods, and downscale is given SSE4.1
optimized versions.

Change-Id: I7cdc256c26850948aef7dae26fda1622be6b8179
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-15 11:25:41 +00:00
Robert Griebl
91dfab223a Add support for unregistering of custom meta types.
This patch addresses a specific Qml problem, where the meta types list
will grow indefinitely when unloading and reloading Qml components over
and over (in an failed effort to save memory).

The implementation is not specific to Qml though, but will cater to all
use-cases where registered types may not live until the application's
termination.

Change-Id: Ic0224dcd19aeb559715ef088b22a30509be2456b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-14 23:29:04 +00:00
Allan Sandfeld Jensen
29380121ef Fix RGB30 painting tests
Some tests were failing because the color was not read correctly from
a QImage. To make it possibly to read more accurate colors a pixel
accessor returing QColor has been added.

Some tests also had the wrong order of arguments, confusing dest and src
formats. This has been corrected, so they test what they claim to test.

A test for RGB30 linear gradients is also added.

Change-Id: Ic623ae1b8e0bf7383056b641c6e8230a1d7dd0dd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-13 13:01:45 +00:00
Erik Verbruggen
b2f6406b6f QStateMachine: remove conflicting transitions after selection.
After selecting all (enabled) transitions for a microstep, filter out
any conflicting transition. The actual conflict resulution is done by
ordering the transitions in order of the states that selected them.

For example: if an event would trigger two transitions in a parallel
state where one would exit that state and the other would not, this
filtering prevents the state machine from selecting both states (as this
case is an invalid state of the whole machine).

This also fixes the exit set calculation for parallel states when one of
its substates is exited and subsequently re-entered in the same
transition. Previously, the parallel state was not exited, and
subsequent re-entry was ignored (because it was still active). Now it is
correctly exited and re-entered.

A side-effect of the transition ordering mentioned above is it also
fixes the non-deterministic behavior of which of the conflicting
transitions is taken.

[ChangeLog][QtCore] Fixed an issue where the state machine could end up
in an invalid state when transitions from a parallel state were not
checked for conflicts.
[ChangeLog][QtCore] Fixed a case where a parallel state was not exited
and re-entered when one of its substates was exited and subsequently
re-entered.
[ChangeLog][QtCore] Fixed the non-deterministic behavior of picking a
transition from a set of conflicting transitions.

Task-number: QTBUG-44783
Change-Id: I2ee72b6a2f552077bfa7aa4d369474ab62f4c2f0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2015-04-10 12:59:52 +00:00
Erik Verbruggen
e616bd2641 QStateMachine: fix history state restoration.
When a history state is entered that has an actual saved history (so not
the initial state), the entry set was calculated wrongly in some cases.
See the bug report for the specific case.

The fix is to fully implement the standard, so method names in the
private class are updated to reflect the names as used in the standard.

Note that, as mentioned in the bug report, the algorithm as described in
http://www.w3.org/TR/2014/WD-scxml-20140529/ has a bug. What is
implemented is the fixed algorithm as described in the current working
draft as of Friday March 13, 2015. This draft can be found at:
http://www.w3.org/Voice/2013/scxml-irp/SCXML.htm

[ChangeLog][QtCore] Fixed an issue where a history state restore would
activate too many states, possibly putting the state machine in an
invalid state.

Change-Id: Ibb5491b2fdcf3a167c223fa8c9c4aad302dbb795
Task-number: QTBUG-44963
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-04-10 12:59:20 +00:00
Allan Sandfeld Jensen
60e8519544 Solid and gradients in high color accuracy
This patch updates the internal color precisions of solids and
gradients to 16bit per color. This makes it possible to render
at higher precision on non-premultiplied ARGB32, the RGB30
formats and any other hi-color formats if more are added.

[ChangeLog][QtGui][Painting] Internal precision of solids and gradients
is now up to 16bit per color.

Change-Id: Ieae5468bd6de1f56adfa4cb9fa966faf2ed824fd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-10 09:15:59 +00:00
Thiago Macieira
28dfda5d1f Remove the old headersclean unit test
We have configure -headersclean now

Change-Id: Iaf576b16d7c756a08ec5c3dfa32deaa343e5e029
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-10 06:34:06 +00:00
Alex Trotsenko
853cba729b QRingBuffer: allow to peek bytes from any position
Add an ordinary peek() function which also allows retrieving data from
a specified position. We need this functionality in several places.

Change-Id: Ia4a1b6fe1d7f76cb8f6f1ea34b3e4b89e05a2a68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-10 05:37:11 +00:00
Liang Qi
4973786f0d Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I04f9f2749f68c0cb5a427b8d84e43b44bb143e4d
2015-04-08 21:24:26 +02:00
Kai Koehne
a60571b370 QSaveFile: Fix permissions on creation
QSaveFile is intended to be a replacement for QFile, and should use the
same permissions for newly created files. QTemporaryFile however creates
new files with 0600 mask by default.

Fix this by making the mode_t argument QTemporaryFileEngine uses
configurable, and using 0666 for QSaveFile (like we do in QFile).

[ChangeLog][Important behavior changes] Files created by QSaveFile do
now have the same rights as files created by QFile. This also fixes a
regression in QSettings: In the Qt 5.4 series, new files created by
QSettings were only readable by the current user.

Task-number: QTBUG-44086
Change-Id: Ie1cc20e9f25c6e72e1bc9176490c419c27c5fc82
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-08 07:48:17 +00:00
Konstantin Ritt
95d034a14f Introduce QQuaternion::fromDirection()
...which constructs a quaternion using specified forward and upward
directions, so that the resulting Z axis "faces" a given forward direction.

Change-Id: Ib77b8ab5c359a4880b0d946face87026acdc6f0b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Michael Krasnyk <michael.krasnyk@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:07:48 +00:00
Liang Qi
20cac3d9c9 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
2015-04-06 19:10:25 +02:00
Marc Mutz
cc164f9ac7 QVarLengthArray: add {const_,reverse_iterator}, {c,}r{begin,end}()
[ChangeLog][QtCore][QVarLengthArray] Added rbegin(), crbegin(), rend(), crend(),
and reverse_iterator and const_reverse_iterator typedefs.

Task-number: QTBUG-25919
Change-Id: Ifda5d420802a3594c3181f54036279f16a7da16e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:49 +00:00
Marc Mutz
f276dd5b7f QVarLengthArray: add relational operators <,<=,>,>=
std::vector has them, too.

[ChangeLog][QtCore][QVarLengthArray] Added relational operators <, <=, >, >= if the element
type supports operator<.

Change-Id: I69e16d361fd4738a56b292ebfa78316d28871eda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:44 +00:00
Marc Mutz
f7b5f0cfd2 QList: add {const_,reverse_iterator}, {c,}r{begin,end}()
[ChangeLog][QtCore][QList] Added rbegin(), crbegin(), rend(), crend(),
and reverse_iterator and const_reverse_iterator typedefs.

Task-number: QTBUG-25919
Change-Id: Icce870c22931e68cdcedd1519651bfa374ac44af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:41 +00:00
Marc Mutz
dfb00bd479 QList: add relational operators <,<=,>,>=
std::vector has them, too.

[ChangeLog][QtCore][QList] Added relational operators <, <=, >, >= if the element
type supports operator<.

Change-Id: Id2bd905e92c0365ad9f439d49908045c8df309c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:37 +00:00
Marc Mutz
4bd81e0b82 Add missing QString::prepend(QStringRef)/(const QChar*,int) overloads
QString::append(QStringRef) exists, and so should prepend().
QString::append(const QChar *,int) exists, and so should prepend().

[ChangeLog][QtCore][QString] Added prepend(QStringRef) and prepent(const QChar *, int) overloads.

Change-Id: I3eca41045f7c481be473507e23e92690f3ed7ba3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-04-02 19:30:05 +00:00
Marc Mutz
2a15c83c90 Add QString::insert() overloads for QStringRef, const char*, QByteArray
The corresponding QString::append() overloads exists,
and so should insert().

[ChangeLog][QtCore][QString] Added insert(int, QStringRef),
insert(int, const char*) and insert(int, QByteArray).

Change-Id: I1cf43fe8908319e2a57415945718b72e69ca0fb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-04-02 19:29:54 +00:00
Marc Mutz
d543b1c3d4 tst_QString: refactor the op+= tests
... using the framework developed for testing QString::append.

Change-Id: I29011eba6438bf9b3daad354cbec4b8e2b98ed81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 19:29:30 +00:00
Marc Mutz
dd350ec2e7 tst_QString: refactor the insert tests
It is tedious to test all the overloads of QString::insert,
so get the help of the compiler to do it. The framework
was originally developed for testing append.

This change showed that the insert(int, QStringRef),
insert(int, const char*) and insert(int, QByteArray)
overloads were missing. They will be added in a separate
commit.

Change-Id: I609b8a05203f8a1ea12827d1798313ace5b719f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 19:29:16 +00:00
Marc Mutz
5ba36ec29e tst_QString: refactor the prepend tests
It is tedious to test all the overloads of QString::prepend,
so get the help of the compiler to do it. The framework
was originally developed for testing append.

This change showed that prepend(QStringRef) and
prepend(const QChar*, int) overloads were missing. They will
be added in a separate commit.

Change-Id: Ic3d6ad011bedc6ee7d5024094d7c3529b1b9d669
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 19:29:04 +00:00
Marc Mutz
ec75c0f684 tst_QString: refactor the append tests
It is tedious to test all the overloads of QString::append(),
so get the help of the compiler to do it. The framework
developed for this will be used in subsequent commits for
prepend and insert, too.

Change-Id: I89df581b6d037a5af80b34dd6b5d37ac7484c774
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 19:28:50 +00:00
Marc Mutz
e486d69133 QString: preserve embedded NULs when converting from QByteArray
Unearthed an off-by-one error in a QByteArray::fromRawData() call in
tst_qtextdocumentfragment. Fixed by porting to QStringLiteral.

[ChangeLog][Important Behavior Changes] All conversions from QByteArray
to QString now preserve embedded NULs. This is done in order to provide a
faster conversion from QByteArray to QString that does not involve a call to
strlen. If you need the old behavior, convert from QByteArray::constData()
instead. If you are porting from Qt 4, we suggest to make your source compile
with QT_NO_CAST_FROM_BYTEARRAY before porting to Qt 5.

Change-Id: Ibca40f503920fee6f3a5f0d74a04b38b8849796f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 19:28:31 +00:00
Marc Mutz
6f145707eb QString::from{Utf8,Latin1,Local8Bit}(QByteArray): preserve nullness of argument
Currently, calling these functions with a null QByteArray will return
a non-null QString because QByteArray::data() never returns nullptr.

This behavior leads to inconsistencies between QString::append overloads,
in particular the QByteArray vs. all others (null + null test always
returns a null QString, except for the QByteArray overload before this
change).

It also is inconsistent with the const char* overloads of these methods,
which explicitly preserve nullness (as verified by test cases).

Fixed by an explicit check for nullness and return of null QString.

Alternative would have been to check for nullness and pass nullptr
instead of ba.data() to the _helper() functions, which do the correct
thing in that case. But since we'd have the check anyway and with the
chosen strategy we can avoid a call to a non-inline method, I opted
against that.

[ChangeLog][QtCore][QString] fromLatin1(), fromAscii(), fromUtf8() and
fromLocal8Bit() now return a null QString when called with a null
QByteArray.

Change-Id: I5f2c0bad27fb73c7d535085af0271823bf6ed1da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 19:28:18 +00:00
Marc Mutz
ffedd0cf64 QVector: add {const_,}reverse_iterator, {c,}r{begin,end}()
[ChangeLog][QtCore][QVector] Added rbegin(), crbegin(), rend(), crend(),
and reverse_iterator and const_reverse_iterator typedefs.

Task-number: QTBUG-25919
Change-Id: I8dea52a08e7b1a4442e034c22b83be4d25dc2303
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 18:49:28 +00:00
Marc Mutz
34c6fbf846 QVector: add relational operators <,<=,>,>=
std::vector has them, too.

[ChangeLog][QtCore][QVector] Added relational operators <, <=, >, >= if the element
type supports operator<.

Change-Id: I0bcb22dfcc43cb0362f17b4e06154ce18646580a
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-02 18:49:20 +00:00
Liang Qi
0e6ee136c9 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/testlib/qtestblacklist.cpp
	src/widgets/accessible/qaccessiblewidgets.cpp

Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c
2015-04-01 09:10:26 +02:00
Thiago Macieira
418869d915 Autotest: fix incorrect test message ignoring
Commit 748abf9347 changed the message, but
the CI either did not run the QtDBus tests when integrating or it
ignored the results.

Task-number: QTBUG-45317
Change-Id: Iee8cbc07c4434ce9b560ffff13d058f21b73ac05
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
2015-03-31 06:50:16 +00:00
Thiago Macieira
9212244294 Fix running of dbus-send on some systems
It was printing the following error:

arguments to dbus_validate_bus_name() were incorrect, assertion "name !=
NULL" failed in file dbus-syntax.c line 248.
This is normally a bug in some application using the D-Bus library.

Change-Id: Iee8cbc07c4434ce9b560ffff13d0586189ba3a79
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-31 05:55:55 +00:00
Glen Mabey
046f325483 Adds qFindFirstSetBit() and qFindLastSetBit().
Two new function families have been added: qFindFirstSetBit() and
qFindLastSetBit() for a variety of integer sizes.  Fast implementations
are included for most platforms.

[ChangeLog][QtCore][QtAlgorithms] Added qFindFirstSetBit() and
qFindLastSetBit().

Change-Id: I89d9d1637ea26070aee5a60be95be1b51bfc84dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-28 00:05:50 +00:00