Improve checking for event/socket notifiers and timers

Starting/stopping timers from another thread may result in errors that
may not appear until hours, days or weeks after if a release build of
Qt is used with the GLib/UNIX event dispatchers. Such errors may
manifest as warnings such as "QObject::killTimer(): Error: timer id 7
is not valid for object 0x2a51b488 (), timer has not been killed" and
application crashes (e.g. crashes in malloc, realloc and
malloc_consolidate).

Initial-patch-by: Eike Ziller <eike.ziller@digia.com>
Task-number: QTBUG-40636
Change-Id: I2de50d50eb1fc7467fcebb9c73b74d2f85137933
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use NonPremultipliedImageSrc shader when painting non-premuled images

Recognize non-premultiplied images and draw them using the existing
NonPremultipliedImageSrc shader so we save premultiplying them on the
CPU.

Change-Id: I3dfc8f9385ff91502d64ccabf4bf54049cc28040
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Fix spin box with fine grained wheel events

Only step the value in the spin box when we have accumulated one wheel
tick worth of wheel delta.

Also fixes the obsolete contructors of QWheelEvent so they set the non
obsolete properties.

Change-Id: Ic6ea4b37afa8eec85a6ca7bdc0d919bf8fb02608
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
QCalendarWidget: move QCalendarTextNavigator into qcalendarwidget.cpp

This is in preparation of a change putting all these helper classes
into the unnamed namespace.

Change-Id: I553b1e23b6cdbe6daa492c2dc4c26406ac580de3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QCalendarWidget: move all helper classes into the unnamed namespace

Saves 1920 bytes of text size on AMD64 / GCC 4.7 release builds.

Change-Id: Ib437d285ca0555eb7a3751b53226093b71b789e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QCalendarWidget: fix a bug when parsing date/time formats

Quoting was not reset after consuming the quoted character.
This bug only manifests when a format contains two quoted
characters.

It's not possible to write an auto-test for this, since
the format is always read from the locale.

Change-Id: I39aff41f20f647c285c971b4d560f9e36d4b82fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Fix too fast zooming in QTextEdit with smooth scrolling events

Do not zoom 1pt on every single wheel-event, but instead scale
the zoom with the size of the angle delta.

Change-Id: Idbe17356c7845ebd0039f655d3e611e71c6f0dd6
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
xcb: support Wacom touch devices; distinguish from tablets

A tablet which can also do touch will show up as several XInput
devices.  The touch device should be treated as a touch pad, not as
a tablet.

[ChangeLog][Platform Specific Changes][X11 / XCB] Wacom touch
devices are not mistaken for additional graphics tablets

Task-number: QTBUG-39572
Change-Id: I7a61a4c0d82925080edb0175b7d03870748f55ce
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Blacklist constantly failing test cases on OS X

tst_qcolumnview fails on OS X # QTBUG-41341
tst_qaccessibility fails on OS X # QTBUG-41340
tst_qnetworkreply fails on OS X # QTBUG-41320
tst_qfontcombobox fails on OS X # QTBUG-41318
tst_macplist fails on OS X # QTBUG-41314
tst_qgraphicsitem fails on OS X # QTBUG-41342
tst_qmdiarea fails on OS X # QTBUG-41343
tst_qtableview fails on OS X # QTBUG-41344

Change-Id: I2626aa61417336805872a807c4a6065b7e0ddb02
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix the drawing of elided text in QHeaderView.

The text was not drawn properly because when eliding the text a fixed
value '4' was substracted from the rect to compute the available width
instead of the actual value of the header margin.

Change-Id: I1e110f1a6490679730ddf5815d3ff7b679dc1a47
Task-number: QTBUG-24772
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Fix QAbstractSocket::readData() behavior on buffered socket

Remove an useless check which spontaneously allow direct reads from the
socket engine.

Change-Id: Ia3d2a572d6f1563d613fe2f00d0d6849df259827
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix MSVC source code encoding warnings in tst_qtjson.

tst_qtjson.cpp(2711) : warning C4566: character represented by universal-character-name '\u2090' cannot be represented in the current code page (1252)
tst_qtjson.cpp(2712) : warning C4566: character represented by universal-character-name '\u2090' cannot be represented in the current code page (1252)
tst_qtjson.cpp(2713) : warning C4566: character represented by universal-character-name '\u2090' cannot be represented in the current code page (1252)

Task-number: QTBUG-41100
Change-Id: I193dc48236bdd3857657a5684178630f0e1dab6d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QRegion: Reorganise members to reduce padding in EdgeTableEntry

On 64-bit platforms: 64 -> 56 bytes.
On 32-bit platforms it's still the same size (44 bytes).

Change-Id: I681b9385ee3bc7601c1e8036efd6544471d1e058
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add unit tests for cleaning up nested functions

I think supporting them now is too complex for the Qt code. We would
probably need to rewrite the parser using a tokenizer so we can find the
right name of the function. Just skipping backwards breaks the support
for returning function pointers and PMFs.

Change-Id: I78636437ecd46d77e6b9b013b2f2668cca1b6cd6
Reviewed-by: David Faure <david.faure@kdab.com>
Fix the number of empty lines between warnings at the end of configure

Change-Id: I9b3e64477331cb7257228b4bf05f9ebb82227009
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Unify the environment variables used for console logging

[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] Support for the deprecated environment variables
QT_NO_JOURNALD_LOG and QT_ANDROID_PLAIN_LOG has been removed. Instead,
set QT_LOGGING_TO_CONSOLE to 1 to force logging to the console (stderr).
Set that variable to 0 to force logging to the system-specific event log
(if any).

Change-Id: I4800fc061752421f67aba1bf4535d524607579d5
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Initialize certain Qt environment variables in testcases

QtTest has its own logging environment, such as XML output, so we don't
want to have messages formatted differently than expected or sent to an
unexpected place.

Change-Id: If665c9d7121267269e5b2063f49468eb2b9b9d08
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Fix warning about sign change (ICC)

ICC doesn't like that you assign -1 to an unsigned variable. I could
have used ~0 to mean the same thing, but actually initialization isn't
necessary at all.

error #68: integer conversion resulted in a change of sign

Change-Id: I3e9116d7309f7a7ccd99b1adfa9bffaed1ff1c73
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
iOS: Implement support for native menus

Change-Id: I2c7278697499aa046ac7b1240b7bc713ad1fc709
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: Add missing LSRequiresIPhoneOS field to Info.plist

This field specifies whether the app is an iOS app.

Change-Id: I38cfcbec97b32f517a14a9a34f1eb871b9fa1ef7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>