Commit Graph

6078 Commits

Author SHA1 Message Date
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
Ulf Hermann
5ab74ffca1 Namespace copy of QFileSystemIterator in QDirIterator benchmark
Otherwise you cannot link it statically against QtCore.

Change-Id: I4ac35602cea2192974f3e96ecad35edac976ce27
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-12 13:52:55 +00:00
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
Friedemann Kleint
0b8cb39d34 Diaglib: Output window/widget state(s).
Change-Id: I0f27027c95ed70a0b2992c58df7e12eddfad17e3
Task-number: QTBUG-46416
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-11 07:55:08 +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
Friedemann Kleint
d7f15e67f9 Manual touch test: Add gestures.
Add command line options for
- Grabbing gestures
- Suppressing mouse and touch events

Add gesture events to the log.
Add a hierarchy of gesture classes storing the parameters
of finished gestures with drawing functionality and
implement for pan and swipe.

Task-number: QTBUG-46195
Change-Id: I019fe5b60116316a54e11b2c30e1d34f5e72bcf0
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-06-06 06:26:39 +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
Friedemann Kleint
b0a1a134c2 Add debug operator for QTouchDevice.
Produces:
QTouchDevice("", type=TouchScreen, capabilities=Position|Area|NormalizedPosition|MouseEmulation, maximumTouchPoints=10)

Remove operator from manual test.

Change-Id: I6b792665031902d5f822c80807a400a334c27526
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-05-22 04:36:41 +00:00
Shawn Rutledge
01d78ba86a Android: generate QTabletEvents for stylus devices such as the S Pen
For example the Galaxy Note series of devices.  This makes possible
drawing applications which handle stylus events differently from touch
or mouse.  As on any other platform, if the application does not accept
the QTabletEvent, a QMouseEvent will be synthesized.
Also fix the tablet manual test to show larger circles on hidpi devices.

[ChangeLog][Android] stylus devices such as the S Pen generate
QTabletEvents

Task-number: QTBUG-38379
Change-Id: Ib594f453b8403cc06aa4e440a76f07afa3bac38c
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-05-21 05:17:38 +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
Friedemann Kleint
f81dda39dd Manual touch test: Draw touch points.
Draw touch points as dots and mouse points as circles
to be able to verify High DPI scaling.

Change-Id: I2293adbcc726391f0d9e156935d609b957432029
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-05-19 11:05:41 +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
Laszlo Agocs
d33edcfe37 Fix the qscreen manual test for separate X screens
It is fully possible to show a window on all the connected screens
even when the screens are not virtual siblings, i.e. they do not
form one big desktop. When X is configured to use a separate screen
for each physical screen, it becomes essential to do setScreen()
either directly or via QDesktopWidget in case of widgets. The original
code attempting to call QWindow::setScreen() cannot succeed since there
is no QWindow available before the widget is shown. This is easy to
work around.

The app now works identically in all cases.

Change-Id: I519ca0c0109c68aac2f2d4e6972d14b55767b403
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-12 08:58:52 +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
Friedemann Kleint
82c3e9edc2 Manual QScreen test: capture screen changes.
- Make the subject of the Property watcher settable.
- Embed it into a QMainWindow with menu and
  listen to the screen changed event, setting
  the new screen with a message about the position.
- Remove hash, close obsolete windows by iterating
  over the top levels looking for the screen.

Change-Id: I4ed1122bab7c0cd9676d63995ce85a44719f4ba6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-05-07 13:04:41 +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
Konstantin Ritt
a37daf99ad [DiagLib] Sync QChar enums
These values were added as part of upgrading to Unicode 7.0

Change-Id: Ib208828a7685ba4f89f0e2f06033f74c8ff13532
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-05-01 05:35:46 +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
Morten Johan Sørvig
795400d1e5 Clean up qt_on_cocoa manual test.
Focus the test on embedding QWindow: Remove the
NSToolBar code. Use standard NSApplication startup
code. Use winId() to access the NSView instead of
QPlatformNativeInterface (which is gui-private).
Rename Window -> RasterWindow.

Change-Id: Ie98cb73020d2721743bb665b89b17f07f2bf984b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-04-30 05:04:07 +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
Andy Shaw
34ec0713bb Add a means to set the application icon where supported
On OS X the application icon can be changed at runtime, so this adds a way
to set this via the QPlatformIntegration.

[ChangeLog][OS X] QApplication::setWindowIcon now changes the icon for the
application in the dock.

Task-number: QTBUG-43999
Change-Id: Ice298c0bd52f10f4866f37c6d3f20cf5419b7a1b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2015-04-10 10:10:25 +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
Giuseppe D'Angelo
51af196ba0 QWidgetWindow: use sendEvent to forward events to the wrapped QWidget
The fallback code for unhandled event types in QWidgetWindow::event
directly called event() on the underlying QWidget (i.e. m_widget->event(e)).

The problem with that approach is that it does not activate any
event filters that can have been installed on the top level widget.
Instead, let's use sendEvent to forward the event to the widget.

An extra modification becomes necessary:
the events received when creating/showing/etc. a widget change,
hence the corresponding test needs to be tuned. On the other hand,
apparently this fixes a long time XFAIL in that test.

Task-number: QTBUG-42281
Task-number: QTBUG-26424
Change-Id: I237bbbc301e3e9e10f071589629c71343a600ef9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-26 20:42:54 +00:00
Kai Koehne
1db3de6a1e QVLA: Add operator= for initializer lists
Add a dedicated operator=(std::initializer_list) that
first resizes the QCLA, and then replaces the elements
one by one.

This should be usually faster than creating a temporary
QCLA and then copying it, except for the case where the
new array does not fit into the allocated stack - but this
is IMO nothing to optimize for.

Task-number: QTBUG-45041
Change-Id: I147d6d01186b1ca3c635b2c8365d8f6e638ce6fe
GPush-Base: 08de3113051e1289f0de0651ec5647c9ee6feb27
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 15:48:13 +00:00
Laszlo Agocs
2266f51922 Fix incorrect FBO bindings with QOpenGLWidget
QOpenGLContext::defaultFramebufferObject() knows nothing about QOpenGLWidget
and QQuickWidget. The problem is that this function (and others that rely on it)
is expected to give the widget's backing FBO in paintGL() and friends.

To overcome this, we have to provide a way for such widgets that indicate what is
the expected "default fbo".

Task-number: QTBUG-43269
Change-Id: I43f439f8609382b9f7004707ab0ef9f091952b4f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-30 20:48:07 +00:00
David Faure
5aa40e5b00 QComboBox: also adjust size on model reset, with AdjustToContents
When the size adjust policy is QComboBox::AdjustToContents, the combobox
sizeHint was recalculated on dataChanged, rowsInserted, rowsRemoved,
and setModel, but not when the model was reset. This led to truncated
items in the combobox when models are filled asynchronously.

Task-number: QTBUG-5413
Change-Id: I3456c327d680dfffa58d6dcb26c79456c67b2a32
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-04-04 12:24:44 +00:00
Alex Trotsenko
f40cf77b0f QIODevice: do not change the 'pos' member for sequential devices
Concept of 'current position' exists only for random-access devices.
As documented, for sequential devices QIODevice::pos() must always
return 0. Prevent a modification of the internal 'pos' member in
QIODevice::readAll() method to follow this rule.

Change-Id: Ida2ee6a629ccfc3068d62f95ab1064ada13fdda5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 08:40:01 +00:00
Caroline Chao
096ac429e7 Tests: remove insignificant flag for dbus tests on osx
Tests are now passing in CI.

Change-Id: I0051fb7070c1c1027c557eba9dde6367ad59ac7a
Task-number: QTQAINFRA-837
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-27 18:37:30 +00:00
Konstantin Ritt
d8a0b97f60 Update CLDR to v27
+ A bunch of fixes in the locale data
+ New scripts from Unicode 7.0
+ New locales
- Some locales disappeared (aa_DJ, aa_ER, st_LS, ss_SZ, swc_CD, tn_BW)
- Some locales lost their contents (i.e. en_Dsrt_US)

[ChangeLog][QtCore] QLocale data updated to CLDR v.27

Change-Id: Iba8c7884f8087e577cbb25a8fc106dd7bd3ebb5d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-27 16:40:16 +00:00
Konstantin Ritt
7946b83ace [QLocaleData] Extract defaultContent locales
This adds some locales missing in the common/main/ directory, namely:
  bss_CM, cch_NG, dv_MV, gaa_GH, gez_ET, ha_Arab_NG, iu_Cans_CA, kaj_NG,
  kcg_NG, kpe_LR, ku_Latn_TR, mi_NZ, ms_Arab_MY, mn_Mong_CN, nds_DE,
  ny_MW, oc_FR, sa_IN, sid_ET, tk_Latn_TM, trv_TW, tt_RU, ug_Arab_CN,
  wa_BE, wo_Latn_SN

See http://www.unicode.org/reports/tr35/tr35-info.html#Default_Content
for more info.

Change-Id: I6b3082d370a21da64fbd5e72ab6344e1d7a6a3c9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-27 16:40:13 +00:00
Konstantin Ritt
dec451cf67 Update Unicode data up to v7.0
* Two newly adopted currency symbols:
  the Azerbaijan manat and the Russia ruble
* Pictographic symbols (including many emoji), geometric symbols,
  arrows, and ornaments originating from the Wingdings and Webdings sets
* Twenty-three new lesser-used and historic scripts
  extending support for written languages of North America, China, India,
  other Asian countries, and Africa
* Letters used in Teuthonista and other transcriptional systems,
  and a new notational set, Duployan

For more details, see http://www.unicode.org/versions/Unicode7.0.0/

The Properties struct's .*Diff members were narrowed down
to signed 15 bits and the unicodeVersion has been expanded to 8 bits.

[ChangeLog][QtCore] Unicode data updated to v.7.0

Change-Id: I93ab6f79fa3b05f61abc7279f1d046834c1c1a0b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-27 16:40:06 +00:00
Konstantin Ritt
ecdd5648bd Update UCD source files to v7.0
Change-Id: I47277963c926128ad0c4ac5141835e767bb440a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-27 16:39:53 +00:00
Marc Mutz
1b109967c5 QUuid: add missing relational operators
QUuid has ==, !=, <, and >. Add <= and =>, too.

Change-Id: I11a0b8028be766e2d48dc7664d935df4d327b3d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 06:40:27 +00:00
Joni Poikelin
fa3985ab22 Do not emit textEdited on inputMask change
Task-number: QTBUG-1266
Change-Id: Ib2f1db15be876c1d6713bd7c28c2b91006b3b2d4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2015-03-27 12:55:57 +00:00
Caroline Chao
3ed6f74fb2 Tests: Blacklist tests for ubuntu 14.04
Instead of making insignificant the all platform for
QtBase 5.5 integration.

Change-Id: Ief3f29c094bdbc90e684f19c1077ee595fb7d581
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-04-01 13:59:04 +00:00
Thiago Macieira
7b2a1aec03 tst_QDnsLookup: Use a different character from space in TXT multi
When in commit db15341d27 I added support
for testing TXT, I used the space character to make it easy to
concatenate the records. Unfortunately, that means it's easy to false-
positive the test by creating one record with a single entry containing
a space instead of two entries.

So use the NULL character instead.

Change-Id: Ia0aac2f09e9245339951ffff13c7d239ea83583d
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-26 06:11:17 +00:00
Thiago Macieira
e1c99e15b6 Update strtoll and strtoull from upstream FreeBSD
There appears to be at least one fix, related to sign- or zero-extension
in the call to isspace(). So it's a good idea to update again. This also
brings the behavior to match strtoll and strtoull on Linux, including
the fact that strtoull will parse negative numbers. For that reason,
qstrtoll and qstrtoull are now wrappers that try and keep the behavior
that we used to have.

This update also changes the code from a 4-clause BSD license (bad) to a
3-clause BSD license (good).

Change-Id: I73b01b02ebd1551bf924599d52284ad25cc1def0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-26 06:11:14 +00:00
Andy Shaw
2e4a107e7e Ensure that CSS rules are inherited from the parent tags
When CSS is set in a head tag then it was not being inherited by the child
tags when the CSS specification indicates that the properties are in fact
inherited. This ensures that those properties are inherited and the non
inheritable ones are unchanged.

A test is added to cover the different situations with inheritance and a
fix is done for the QTextDocumentFragment test which was passing despite
having incorrect defaults.

Task-number: QTBUG-28770
Task-number: QTBUG-34153
Change-Id: I55966240845a885852a04ecb82c61926dea9f800
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-25 11:55:47 +00:00
Liang Qi
26a9783d55 Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5 2015-04-01 11:27:03 +00:00
Liang Qi
ce9519593a Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	mkspecs/android-g++/qmake.conf
	qmake/generators/unix/unixmake2.cpp
	src/gui/image/qimage_conversions.cpp

Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
2015-03-31 10:03:31 +02:00
Frederik Gladhorn
0bd06bd9bd Fix building test qpluginloader/machtest against installed qtbase
When building the test while qtbase has been installed and the
build dir was removed, the include paths were not found in
frameworks builds.

Change-Id: I32d9e61176a5e19c86095580ddad6914f25ff952
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-25 10:03:38 +00:00
Friedemann Kleint
e1ce8dca16 Fix build of the manual dialog test with Qt 4.
Change-Id: If2b0ae9842ebc2795168d2c50934b8a87006544b
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-03-25 09:51:28 +00:00
Boris Dušek
76c94be4e7 OS X Accessibility: Make checkboxes etc. checkable with VoiceOver
NSAccessibility has no explicit analog for
QAccessibleActionInterface::toggleAction(), checking checkboxes/radio
buttons is handled by NSAccessibilityPressAction. So ensure exposing
the action properly on OS X so that VoiceOver users can check/uncheck
checkboxes, select radio buttons etc.

Change-Id: Idc8b048de2313a3e875a929516baf3dded9c68cc
Task-number: QTBUG-44852
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:43 +00:00
Boris Dušek
c37f2e8e45 Add string range tests to qaccessibilitymac
Change-Id: I099502d4948194d934ace1fabc5e3ce14f663eb9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:35 +00:00
Boris Dušek
da3dbc45f3 Refactoring of qaccessibilitymac test
In order to support testing values of more accessibility attributes
and parameterized attributed, we provided some "infrastructure" to be
able to query them with minimal effort. We also reworked current 6
supported attributes to use this new way.

Change-Id: Id0ceb59aa0fe063c9aedad27cffcc3aef0899d7f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:27 +00:00
Boris Dušek
551f39bac5 Fix accessibility character rect tests
textEditTest in qaccessibility test was using QTextEdit::setCurrentFont
on second pass, but that did not change the font used for text in any way.
I don't know what was the purpose. So I changed it into something that
made sense to me and actually tests text with a different font on second pass.

Also fixed characterRect function in tests to use correct font/format.

Change-Id: I843c5b29f8048196ec3405b6717655e77b567dbb
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:47:52 +00:00
Boris Dušek
898ca6ff76 Fix tst_qaccessibility::textEditTest for some screen resolutions
On a high resolution display the test will potentially create a text
edit that introduces line breaks and these make it fail then.

Change-Id: I38807a9b3b511478a1742c4422a97c1cb3395a02
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:47:40 +00:00
Boris Dušek
b465edbcab Support all underline types in accessibility
Change-Id: I9eccc66624f5d789cc8778d4376338207beb4a14
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:47:17 +00:00
Morten Johan Sørvig
72854081b2 Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Liang Qi
135ebe4f3d Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: If5d2e621c2fa5476c3ab687a3f4620c54fc3b32e
2015-03-24 07:38:02 +01:00
Pasi Petäjäjärvi
ddf6ac03cb Do not search test binary if QProcess is not supported.
Without QProcess support we do not run test which initTestCase is
trying to find.

Change-Id: Icecaad90f61a019489e372517a6d62372155bd46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-23 08:38:58 +00:00
Kai Koehne
d3659bf88b QVarLengthArray: Add initializer_list constructor
Implement an initializer_list constructor, which was probably
just forgotten so far. Technically this is a SC incompatible change,
since

  QVarLengthArray<int> array = {10};

will now create an array with one element 10, instead of an empty array
with a reserved size of 10. Anyhow, keeping the inconsistency with the
STL / other Qt containers here would certainly do more harm than good
in the long run.

Task-number: QTBUG-45047
Change-Id: I4675880f93e141181250939942fa32300916b0e3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-03-23 08:13:42 +00:00
Konstantin Ritt
3cb2e0dd09 Clean-up tst_QChar
Since Qt 5.0, static overloads of QChar has a uint parameter only,
so there is no more ambiguity between uint<->ushort and thus some tests
does not make sense anymore; avoid explicit cast to uint for the others.

Change-Id: Ibc7a2ac4de63d3f023a8dbb5e53211ef8521579d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-23 07:01:27 +00:00
Frank Reininghaus
f1e9076809 Fix problems with extended selection after changing the model contents
Storing the position of the first selected item in the view can lead to
wrong extended selections if the contents of the model change. Future
Shift-clicks will always use the previous position of the first selected
item, which may not be correct any more, to calculate the current
selection.

To fix this problem, a QPersistentModelIndex is used to keep track of
the first selected item.

A new unit test is added. Moreover, one function of the QTableView unit
test is changed such that it shows the view prior to performing the
test. Without this change, this test may fail. That the test, which
simulates mouse presses without showing the view, worked at all seems
to be a coincidence, as pointed out in QTBUG-18009.

Task-number: QTBUG-18009
Change-Id: I0d844fbd1a994c279a7c8ee5d9b5b9fccecd25bf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-03-22 14:38:07 +00:00
Andy Shaw
b6c14bca65 MySQL: Fix test so it expects the right integer type
Change-Id: Idd90d7881c6458fac7602bf02dad0f794d3b98c9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-20 13:51:34 +00:00
Andy Shaw
392d861790 MySQL: Keep the precision of the field when formatting the value
Change-Id: I4ab08be5112167a617d6d1d109754f2404a9605f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-20 13:51:29 +00:00
Friedemann Kleint
3e503b197d Diaglib: Add gesture events to event filter.
Task-number: QTBUG-45134
Task-number: QTBUG-45120
Change-Id: I9b2420ec302dfff173fbc8e3173d6ef0fcf095e0
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2015-03-20 12:27:21 +00:00
Eirik Aavitsland
d5c6335ff3 Fix rasterization errors in aliased cosmetic drawPolyLine
If a cosmetic polyline contained a 1-pixel segment, the next segment
would be drawn with wrong starting point.

The original fix for QTBUG-26156 had some unwanted side effects
(QTBUG-31579 and now QTBUG-42398). It tried to skip start-point update
if stroke() did not actually draw anything (because the segment was
too small). However, to determine that, it tested for a change in
lastPixel. But that was not failsafe; in some cases (1-pixel segment),
lastPixel could be unchanged even though the segment had been
drawn. With this change, we instead test directly whether stroke()
skipped the segment or not.

Task-number: QTBUG-42398
Change-Id: Id751db69a18cd1af4f45070db9d5698aa532d22a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-03-19 09:01:08 +00:00
Andre Hartmann
e610ef8c8d QComboBox: Update completer on setCurrentIndex()
When the ComboBox currentText() was changed by key
LineUp or LineDown or mouse click, the completer still
contained the last inserted characters.

If now all text was selected (by Ctrl+A or selectAll()),
the old item and index was restored on next Enter press.

Task-number: QTBUG-41288
Change-Id: I6916fd31c8b8fbacfb12e1a62c3e46823cf918b4
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-03-18 16:57:19 +00:00
Marko Kangas
ce97f37bff Fix tst_largefile QCOMPARE value types
Added casting to QT_OFF_T type. Otherwise fails on some
compilers.

Change-Id: I4f1f0c558af7d182a4babf38a7f048b27b3db611
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-18 13:35:40 +00:00
Lars Knoll
0411240fda Make sure remove() doesn't corrupt the json object
When using non latin keys, remove() could cause corruption
of the json object.

Task-number: QTBUG-42270
Change-Id: I7305e57ebb78630a9bf68bc4f831a6d1646abb79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-18 07:34:59 +00:00
Lars Knoll
124da60c1d Fix support for iso8859-16 when compiling with ICU
ICU doesn't support iso8859-16, so we need to fall back to
the Qt codec for this encoding.

Task-number: QTBUG-45053
Change-Id: I9754cf098c906fe8a75363a3d090029543cd0e35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-18 07:34:55 +00:00
Olivier Goffart
7c77013c7f Fix source incompatibility while connecting signals with forward declared arguments
QObject::connect tries to determine if the arguments are registered
metatypes. This used to work even for arguments that were forward
declared. But now, the metatype system tries to call
QtPrivate::IsQEnumHelper<T>::Value to know if it is registered.
That fails on gcc if T is forward declared.

Apparently gcc needs to know the full type of T to pass it in the
ellipsis function, even within a sizeof expression.

So change the ellipsis expression to a template one.

Task-number: QTBUG-44496
Change-Id: I7fa07bd3cde470b134c2ec53b0d581333d16a6f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-18 07:33:19 +00:00
Thiago Macieira
699e7a0869 Remove the tests for Ubuntu Oneiric (11.10)
This system is no longer in the CI rotation and we haven't had reports
of the same issues happening on later versions. Either the issues have
since been fixed or they were never an issue in Qt in the first place.

This commit has the additional benefit of getting rid of the following
shell error when qmake was run:
	sh: line 0: [: =: unary operator expected
as /etc/lsb-release hasn't contained DISTRIB_CODENAME for some time and
proper quoting was never implemented (not even qtcpsocket.pro).

Change-Id: Ia0aac2f09e9245339951ffff13c829e910ee64e9
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-17 01:26:13 +00:00
Tor Arne Vestbø
8fe016158f iOS: Skip tests that don't make sense or don't work on the platform
Change-Id: Id6777bdf430ad8a8e3b432caf5000bea8f7860b6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-03-16 14:25:27 +00:00
Erik Verbruggen
8e12367a94 QStateMachine: add objectName to objects to ease debugging.
Change-Id: I3c495cc5bd04c0cac24d4abf827d6acfb35b8433
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-16 12:55:00 +00:00
Erik Verbruggen
cd4fbead3b QStateMachine: fix warnings in test.
- removed an unused field
- initialized variable that might be used uninitialized.

Change-Id: I7a7a063f025ecc32fa462dd8d5e2485c2ba52eb8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-16 12:54:54 +00:00
Marko Kangas
bc69fd1dfe Skip instead of entirely excluding tests with disabled features
Properly QSKIP tests that use disabled QProcess and symlink
features instead of excluding them silently by #ifdef.
Other reason is that moc doesn't respect QT_NO_* defines
in class definition which causes build issues on some
platforms.

Change-Id: I041020f7452f7d36c7ec8a5866a4ba5eb23d1f94
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2015-03-16 09:34:15 +00:00
Simon Hausmann
198606f6db Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/plugins/platforms/xcb/qxcbnativeinterface.cpp
	src/plugins/platforms/xcb/qxcbnativeinterface.h

Change-Id: I31b38ba439b9341d51a01c0fd54bea33f7410076
2015-03-16 10:31:07 +01:00
Thiago Macieira
97f489e7b9 Network tests: don't try to test against disabled network interfaces
Other parts of tst_qudpsocket.cpp already did this check.

Change-Id: Iee8cbc07c4434ce9b560ffff13ca545a03c9596a
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-16 05:30:44 +00:00
Alberto Mardegan
748abf9347 Add QDBusMessage::createTargetedSignal()
The QDBusMessage::createSignal() static method doesn't take a parameter
for specifying the destination service of the signal. While this is not
a widely used feature, it can be useful to avoid waking up all connected
clients when the service knows what are the clients which are interested
in the signal.

This commit adds a QDBusMessage::createTargetedSignal() method which
also takes the destination service as its first parameter.

Change-Id: I9fdca53673a6944c39c93c1efd69a9d02859684e
Task-number: QTBUG-44704
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-14 19:01:49 +00:00