Fix QFontMetrics width

Commit f4dd534 introduced a regression, so that QFontMetrics reported
a wrong size (to be more specific width) for FreeType fonts.
The calculation of glyph advances has to to reflect (rounded)
integral number of pixels. This was only done when the glyph was cached.
So in some cases the first call to QFontMetrics::size gave a different
result than the second.
This patch reverts f4dd5344fbbce257a40e014acc4e87f4773f40.

The tst_QFontMetrics::same auto test only happened to work on some
platforms, on BlackBerry for instance it did not. Extended the test
case to make sure it works for different font sizes.

Change-Id: Ia5bb9abd3ff98193c9bba048b85207672ed8d9c3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Loosen checks for Q_COMPILER_VARIADIC_MACROS

So far we did bind the definition of Q_COMPILER_VARIADIC_MACROS to
C++11 (so gcc, clang will not define it in default gnu++98 standard).
However, variadic macros are a feature of the gcc preprocessor since
version 2.97, and are enabled in the default configurations on gcc, clang,
icc.

This might cause warnings and errors though if one enables additional
warnings in gcc, clang (e.g. by -pedantic). Anyhow, as a precedent
qglobal.h already relies on  'long long' ... The warning can be disabled
by adding '-Wno-variadic-macros'.

[ChangeLog][Compiler Specific Changes] Variadic macros are now enabled
more liberally for gcc, clang, icc. If you have warnings (because you e.g.
compile with -pedantic), disable them by -Wno-variadic-macros.

Change-Id: Ie979b85809508ad70cab75e6981f20496429f463
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Windows: Ensure clipboard is flushed out before QGuiApplication is destroyed.

Otherwise, OleFlushClipboard() might query the data again which causes
problems for QMimeData-derived classes using QPixmap/QImage.

Task-number: QTBUG-36958

Change-Id: I89e58eeb64bd3481e89ad789f310f19ddb4604a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
QTextObject: replace a use of an inefficient QList with QVector

The QTextLayout::FormatRange is larger than void* and thus should not be held in
QList. Use a QVector instead.

This is public, but as of yet unreleased API.

Change-Id: Ie04a561b43c91c3b2befb3cac2981821f84d5f77
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Fix paint artifacts.

Android is using double buffering, so, we need to repaint the bounding
rect of the repaint region, otherwise black holes will appear.

Change-Id: I21f36a6f5f1a6c64b605c0fef3af10dfdc5ec6e2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Rework the splash screen for Android.

Allow the developers to define a splash screen which will be visible
until the first window is created.

[ChangeLog][Android] Allow the developers to define a splash
screen which will be visible until the first window is created.

Task-number: QTBUG-30652

Change-Id: I5da80be417ffffb03e66009f45745d4b387d2912
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Avoid truncation warning in openglwindow example

msvc shows a warning about double -> float truncation. Avoid this.

Change-Id: I1b74cf407c81c881df5e95cc7d64a210888595e3
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Remove QT_OPENGLPROXY_DEBUG

Change-Id: Iac4c5217eca88ac14acca55d19e421d8e33cdb1d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
eglfs: Fix swapped red and blue with QOpenGLWidget

Change-Id: I0793d0b53c0e7df65fecfe43ef9daaf07413ea77
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Avoid using GLX Pbuffers on Catalyst

Trigger QOffscreenSurface's fallback mode (hidden QWindow and a regular window
surface) instead. queryDummyContext() already works like this but the same must
be done for any QOffscreenSurface.

Task-number: QTBUG-36900
Change-Id: I64176ac6704e9d6ed768fa3d456c40c8818be6dc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Expose NPOTTextureRepeat in QOpenGLFunctions

Desktop GL 2.0 and higher supports GL_REPEAT on non-power-of-two
textures. GL_ARB_texture_non_power_of_two mentions this explicitly
in issue #8.

Change-Id: Ia7f3b412b39cca4bec8a6caec3b1281b4c29ab75
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Strip any trailing spaces from the filename before trying to open it

On Windows, trailing spaces in a filename are silently ignored, so we
need to strip it before trying to open a file with it. Otherwise it ends
up being stripped later and in a case like " ." it will end up causing
Qt to think that a folder exists when it does not.

[ChangeLog][Platform Specific Changes][Windows][QtWidgets][QFileDialog]
Handled the case of having trailing spaces in a filename correctly so if
the filename ends up being empty that the parent path is used instead.

Change-Id: I6500cc3a44746bf4a65e73bcfb63265a0a97c8a3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>