native android support with eglfs

Enable eglfs build against any android > 4 tree,
linking to native libs without emulation layers,
running on top of surfaceflinger.
No GNUs where harmed in the process.

Yes, any android.
Tested on maguro, tf300, eeepc-x86
x86-64 compiles but broken elsewhere.

You don't need an Android.mk, but you must compile from within
a shell setup with androids "lunch" or an equivalent that set TOP and OUT.
Since we do callbacks to androids build system,
the same env restrictions apply (must use gnu bash, and gnumake 3.81)

Done-with: Samuel Roedal <samuel.rodal@digia.com>
Done-with: Robin Burchell <robin+qt@viroteck.net>
Done-with: Brian Avery <brian.avery@nokia.com>

Change-Id: Iec0178cdeadbeefc79e4fe6ef449d399ac8ca666
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Return if header is 0.

QT-BUG: 184868

Change-Id: Iff041c66fdfb2267e0349bdd47fec0fe63b1799d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
compile fix for MSVC 2008 and std::upper_bound

qUpperBound was replaced by std::upper_bound.

Unfortunately the STL of MSVC 2008 enforces
the definition of the operator in both
directions.

Change-Id: I3e0f775c23e43332d106e0847d3611e488da6c06
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Update the window style when the modality changes on Cocoa

On Cocoa if the modality of a dialog changes then the style of the
window needs to change to reflect this. So we add a variable to
cache the windows modality when it is created to compare against when
being made visible.

Task-number: QTBUG-22316
Change-Id: I7bfd016321510a9ec70ccb90672f5203a0f3a468
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
CMake: Improve QT5_GET_MOC_FLAGS macro

We need to handle CMAKE_INCLUDE_CURRENT_DIR for include directories.
Otherwise generated files located in the current binary directory are
not found as expected.

e.g. *.json file as meta data for Qt5's plugins generated at build time.

Change-Id: I14ae1e7013f9d8b485aa990d50db4a03ca4f4b81
Reviewed-by: Yuchen Deng <loaden@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Windows: Append file suffix in save-dialog.

Task-number: QTBUG-27186
Change-Id: I04304fce1cbf6fb6794f352ff896eb463699d42b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Mac: Safely dispose of scrollbars temporary NSGraphicsContext

When rendering transient scrollbars, we instanciate a specialised
NSGraphicsContext since those need non-opaque rendering. This context
is being used as current context, but it was never properly released
and the previous context never properly restored.

Task-number: QTBUG-27327
Change-Id: I4e867e64a09368dbe64b84b17f07fd8e57bbae24
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Fix segfault when delegates change properties on editors.

The solution is similar to that
in b84e180263d0da3d1e6967fcf759225a778ea6ea which affected
QSortFilterProxyModel.

Task-number: QTBUG-25370

Change-Id: I6bbb9d9786bcb2c9fa8027ab8a7cc13664784b8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Remove unused placeholder from qErrnoWarning().

The intention probably was to use __FUNCTION__, but since
Qt logging can now be configured to print the function name
by setting environment variables, just remove it.

Change-Id: Ic87aebfea633dd91eda7376b33ca3b14d1cab93f
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
test: Remove QSKIP from tst_QToolButton::triggered()

This test actually passes on Mac OS X, so removing the QSKIP

Task-number: QTBUG-24374
Change-Id: I0b761ca9c30afc9d511e9962ee1c0958b863b374
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Cocoa: fix regressions in cocoa filedialog helper

mOpenPanel is set to 0 if save file dialog is used so call
mSavePanel instead.

Fixes regression introduced in
2e902799df6298ad4c75b4c565a0baf9cb7f7ab8

Change-Id: Idb93e44437731cad3c985d51b57b793a3ff2f292
Reviewed-by: Pasi Matilainen <pasi.matilainen@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Run per-QWindow native event filter for all events.

Task-number: QTBUG-27101

Change-Id: I064f91e250d68223da3b81d605e522c8b78535f5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Fix Windows mouse enter/leave event generation

QWidget::underMouse() did not report correct widget in cases where
mouse was grabbed by popup, which was especially disruptive in case
of QCompleter popup, as that wouldn't close anymore with off-popup
clicks.

Root problem was that mouse capture in Windows caused enter/leave
events for QWindows to be generated incorrectly.
QPlatformWindow documentation specifies that enter/leave events
should be sent independent of explicit mouse grabs and only automatic
mouse grabbing done when button is pressed should suppress
enter/leave events. Updated Windows mouse handling to conform to
this.

Task-number: QTBUG-27283
Change-Id: Iecf786a702f7d29e6026c42ff8ec4c9cbf1b6ac3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Use slogger2 for logging on Blackberry instead of writing to stderr

Change-Id: Id0137400f18c8dfe7be7ca44670c16615401d424
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
QSqlTableModel: fix segfault when overriding selectRow()

The STL-style iteration over the cache in submitAll() assumed the
iterator would remain valid until reaching cache.end(). This failed
to consider that virtual selectRow() might be overridden so that
it removes rows from the cache. For example, it might call select()
which would empty the cache.

The new approach checks at each iteration whether the row is
still in the cache. Using foreach here is justified by its fitness
for purpose and readability.

New test included.

Change-Id: Idee8807ede239c3ba56ff1604574c49f47385ad2
Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
Add docs to clarify and restrict what the LayoutChangeHint means.

Change-Id: I1b786c5151bcce253b6afa1eebc85e864ed7e91f
Reviewed-by: David Faure <david.faure@kdab.com>
QMacStyle: use proper pimpl

QMacStylePrivate needed to be revised in order for it to have access to
QCommonStylePrivate that is planned to manage style animations in a
generic fashion in the near future.

Change-Id: I03185ae210d2cfc253a236d6b2da35d0201f7e13
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
QSqlTableModel: don't cache unchanged value in setData()

This is good for performance in terms of avoiding unnecessary
database activity and keeping the cache smaller.

Detail:
This change was not included in the big refactoring of QSqlTM. The
idea was that the model shouldn't second guess the intention of the
application and maybe the application wants to cause a submit.
It was a marginal consideration.

Now I think it's clear that our interest in not unnecessarily
expanding the cache outweighs that. In addition, applications can now
call selectRow() if they worry that the database values for the row
have changed and want to set a value back again.

Test added.

Change-Id: I63814dcb63a96c6ba1c8cc227807725a954a0b68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
QSqlTableModel: restore use of virtual setData() in setRecord()

setRecord() should use setData() as intended so that reimplementations
of setData() in subclasses will be respected.

Commit 11bd543d901f67f79db3f5b5dfaa626c6e8faa45 failed to consider this.

Test added which should prevent this mistake being repeated.

Change-Id: Ia2d930cd42b5a27521bb389edb1b07fb1bf0fa36
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
QSqlTableModel: record(row) must use virtual data()

Commit fbf010a26617b3986e9a76bd9c004403aebfcdc2 introduced a version
of record(row) that includes the generated flags, but it neglected to
populate the values using virtual data() as QSqlQueryModel correctly
does.

Test included lest we forget again.

Change-Id: I49d0f8f87cd0c5078aa6a0e8373b2cffc01f2387
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>