Prevent crash due to giving QWidget::update() a large rect.

We can simply clip the update rect against the widget's rect and return
if it's empty. Otherwise we risk ending up with update rects that are
larger than INT_MAX due to multiple update rects being merged.

Task-number: QTBUG-30876
Change-Id: I23bd0149fbe8d1a007a60b228e6bddb45dc4fc32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Fix QKeySequence matching

QKeySequence failed to find a match in the shortcut table when QKeyEvent
contained Qt::GroupSwitchModifier modifier. It's not a part of the shortcut,
it simply shifts character group in a keyboard mapping table.

Task-number: QTBUG-26302
Change-Id: Id91cd4999777f7085068e9dba5cb22b40653e23d
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Fix possible race in QMutex

As described in the QTBUG-30872, there may be a race condition involving
3 threads fighting for a mutex.  I am surprised it was not caught
before despite all the Q_ASSERT and the stress test in tst_qmutex.

We do not need to call store(0) because the unlocking thread will
eventually remove the BigNumber flag. And perhaps it even did it
already, and another thread has incremented waiters (hence the Q_ASSERT
is wrong)

Here is a paste of part of the description from the bug report:

---
many threads, one of them is ready to release mutex, while at least two other trying to acquire it
d->waiters is 0
Thread 1 release mutex in unlockInternal:

   if (d->waiters.fetchAndAddRelease(-QMutexPrivate::BigNumber) == 0)

d->waiters is now -QMutexPrivate::BigNumber
Thread 2 try to acquire mutex in lockInternal:

   old_waiters = d->waiters.load();
   if (old_waiters == -QMutexPrivate::BigNumber) {
   if (d_ptr.testAndSetAcquire(d, dummyLocked())) {

It acquire 'about to release mutex' by changing d to dummyLocked
Thread 1 continue release procedure:

   d->derefWaiters(0);

d->waiters is now back to 0
Thread 3 try to acquire mutex in lockInternal:

    while (!d->waiters.testAndSetRelaxed(old_waiters, old_waiters + 1));

d->waiters is now 1
Thread 2 continue its dummy lock:

    d->waiters.store(0);

d->waiters is force to 0

Thread 3 continue wait procedure
but it realize that mutex was already unlocked so decrease back waiters

   if (d != d_ptr.loadAcquire()) {
   if (old_waiters != QMutexPrivate::BigNumber) {
   d->waiters.deref();

d->waiters became negative value of -1
Neither thread need internal data so it is released back to pool
The waiters counter in released internal structure is still -1
---

Change-Id: I1b22555db764482775db6e64a8c9ffa9e1ab0cf6
Task-number: QTBUG-30872
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
uclibc/pcre: Fix the linking of libQtCore for mips/uclibc

The mips/uclibc features.h of the toolchain used by a former key
account of PSO is defining both __USE_XOPEN2K and __USE_BSD this
will lead to POSIX_MADV_* and MADV_* being defined while only the
symbols for madvise are present. Change the order to make it link.

Change-Id: If324b978d72ad2b37b8cd624562e81503c9465d4
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Make sure window is updated on resize event

After 475d1ed4f6a21686828fbd018542b469a8b2dbcd in qtdeclarative,
orientation changes on Android were broken, because the resize
event no longer implicitly causes an expose event. So we need
to post both when doing the resize.

Task-number: QTBUG-30909
Change-Id: I87c8c38e14d96a03b3409ef6439c3ac6ef432005
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
test: Mark tst_menubar::task256322_highlight as XFAIL

This test is unstable on Mac OS 10.7 with developer builds, so marking
it as XFAIL if it happens to fail.

Task-number: QTBUG-30565
Change-Id: If7094c3b19299f0dbe57cb82a8614032a75573d8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
fix quoting issues in vcxproj generator

Fix passing of preprocessor definitions with double quotes to the
resource compiler and to MIDL. Both have a different escaping mechanism
then the C/C++ compiler tool. This fixes a regression introduced in
9e9911715c37511ece018aa9d36491b77872501b.

Task-number: QTBUG-30859

Change-Id: Ifa041df407030320847373a5964a547c39dd5439
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
iOS: Don't resize backing store twice in beginPaint()

The first call to resize() was a left-over from before we had retina-support.

Change-Id: I637e8d40f443f81fe7cfc367650bb28b917da2bc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Add some extra tests for QString::arg

Test locale-based formatting of numbers when we pass field width, base
and fill characters. This now tests the fact that we replace a '0' for
the locale's zero character.

Change-Id: Ib872a592fd9a754e3ef11495a9497a6947056631
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Doc: Give C++ class lists consistent titles

The majority format is "<Qt Module> C++ Classes" (see
http://qt-project.org/doc/qt-5.0/qtdoc/modules-cpp.html)

Also, fix a broken link (Qt Network C++ Classes)

"<Qt Module> C++ API" is perhaps the more correct format, but that's
part of a much bigger cleanup: QTBUG-30556

Change-Id: I753365e2bec8d85d9a5f686b4aa35c9eeeaf0871
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>