Make sure plugins under LTCG get the right flags too.

Change-Id: I51384b4c3ceca25b6e010ccf67fa0f1995cfa557
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Fix linking of sources without LTCG to a static lib with LTCG

Whenever a binary is created and linked against a static lib that was
compiled with LTCG, the final linking step requires the compiler flags
so that the pre-compiled data in the shared library can get properly
compiled.

This could happen for a static build of Qt with LTCG, but also happens
frequently for Qt's own build when linking regular libraries and
applications against QtBootstrap or QtPlatformSupport. The linking fails
when the target is a shared library (example: QtWaylandClient linking
against QtPlatformSupport).

The .prl file actually contains the "ltcg" flag, so the best solution
would actually be to process that flag there and add link_ltcg if any
dependent .prl has "ltcg", but I couldn't find out how to do that.

Change-Id: I4a75a14d1dcb8c2089a427285e25d5555df7d7d3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Un-tighten the WinRT specific code out of qfunctions_winrt.h

Keep the WinRT specific parts for WinRT only. This commit is a partial
reversal of 67c83f329e7fb6fbf5d8e402f42ea8916c34f01c "Tighten Q_OS_WINRT
ifdefs in qfunctions_winrt.h", which let the WinRT definitions out too
wide.

Strictly speaking, the C++ code that uses
Microsoft::WRL::ComPtr<IAsyncInfo> without the #include is broken. The
forward definition is not enough, but since Visual Studio is also
broken, two wrongs made a right... (MSVC does not implement two-stage
parsing of template code properly). But if you accidentally tried to
compile qfunctions_winrt.h with a non-broken compiler, like GCC (MinGW),
it would correctly complain.

Change-Id: I7591015861d291a82050afe0f4df0cb18b43e23d
Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Fix placement of QT_{BEGIN,END}_NAMESPACE in qfunctions_winrt.h

Those functions weren't getting properly namespaced. Even if we're
testing WinRT namespaced builds, it wouldn't catch this mistake: those
functions would simply all be in the global namespace. I guess we don't
have a "namespace cleanliness" test.

Change-Id: I2d3d09dc66dad476563dbf51c171683be155ebfd
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
QMainWindow: Observe left contents margin when positioning status bar.

Task-number: QTBUG-38152
Change-Id: I4c762a113dbfe47472d1087aa34c0e327083ee16
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
QLayout: Observe contents margin when positioning the menu bar.

Task-number: QTBUG-38152
Change-Id: I53ea6bce33057251265a7eca1651aeabca314ba9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
QNetworkReply::abort will also call finished()

Change-Id: I86e493178bf523c47eed36015354c0fbbebd56d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix build due to source incompatible change with FreeType 2.5.4

http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=b3500af717010137046ec4076d1e1c0641e33727

../gui/text/qfontengine_ft.cpp: In member function ‘QFontEngineFT::Glyph* QFontEngineFT::loadGlyph(QFontEngineFT::QGlyphSet*, uint, QFixed, QFontEngine::GlyphFormat, bool) const’:
../gui/text/qfontengine_ft.cpp:1126:39: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
                        for (int x = 0; x < slot->bitmap.width; x++) {

Change-Id: Idb58f9e5895aac8c02163870d7c7d4a49237086b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
iOS: Use DISTCLEAN_DEPS instead of custom distclean target

Change-Id: I1fb6dc4c9ef3623f58a9c8412499df7b9f9ff9bf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
iOS: Refactor QIOSKeyboardListener implementation and usage

QIOSKeyboardListener takes care of both maintaining the virtual keyboard
state, and acting as a gesture recognizer for the hide keyboard gesture.

We make this explicit though a union in QIOSInputContext, so that we can
access each 'mode' separately. This improved code readability and allows
later refactoring of the state and gesture into separate classes without
changing the call sites.

Change-Id: Icc60f4a542983cda7ca0fd6622963d32d1e90db9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
iOS: Simplify view management in QIOSKeyboardListener

We don't need to keep track of the view-controller or add ourselves as
a gesture recognizer inside QIOSKeyboardListener. In fact, leaving the
call to removeGestureRecognizer in [QIOSKeyboardListener dealloc] will
result in QIOSKeyboardListener never being released, as the view that
we add the recognizer to will keep a strong reference to the recognizer,
so dealloc is never called unless the view is also released, which is
unlikely to happen. We now fully control the lifetime of the recognizer.

Change-Id: I6755e8cdfcc8f1062314db51aa54a2b7ecd1b967
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
iOS: Properly support QInputMethod's visible and animating properties

We now emit and change the 'visible' and 'animating' properties of the
QInputMethod according to the documentation, which means the 'visible'
property will change immediately when the keyboard is about to become
visible, or about to hide, and the 'animating' property will determine
if the visibility-change is just starting out, or has ended.

The keyboard rect will at all times reflect the currently visible area
of the virtual keyboard on screen (in focus-window-coordinates), not
future state after the animating completes. Getting the future state
is a missing piece of the QInputMethod API, and could be solved in
the future by adding arguments to the animatingChanged signal that
allow platform plugins to pass on the before- and after states.

The logic for determining the keyboard state has been moved into
a central function, updateKeyboardState(), which allows us to change
and emit property changes atomically. There is still some parts left
of the old approach, but these are left in to make further changes
to the code easier to diff and understand in isolation.

Change-Id: Ica52718eba503165ba101f1f82c4a425e3621002
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
iOS: Guard against UIGestureRecognizer messing with self

We pass in self to initWithTarget, so we need to be sure that the
init doesn't return a new self.

Change-Id: I90d0d10d2fd1a5d38ef1ff3f23169dcce00b28e2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Make sure that created surfaces are stacked on top of previous ones.

The old code would stack the new surface just below the topmost surface.
It also did not consider if the m_editText was added to the layout or
not (thus, m_layout.getChildCount() - m_nativeViews.size() - 1) was only
correct if the editText was added.

Spotted by plain code reading while investigating some accessiblity
issues.

Change-Id: I12c9f373a471c0a7ee624a47232e8952d69c9067
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Remove unneeded call to m_editText.bringToFront()

There is no need to call bringToFront() when the item was just made to
be the last child in the two previous lines. (Child views are ordered
in stacking/paint order)

Change-Id: Ie9fbe5de6dce2bbc96cd44a8a6a779504cd0becd
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Pass cflags, not incdir, to libudev config test

The compile.test script expects -I... parameters. Passing just the
include path is therefore wrong. Pass cflags instead.

Change-Id: I0f9b155d1e710fe7d77c64a867a89290d4f31db3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
fix rc compilation in vcxproj files

We don't need to modify ResourceOutputFileName. The default is fine,
and $(InputName) evaluates to nothing in VS >= 2010.

Change-Id: Ib203d36261e1b5449c5a139b1950bd0d66197297
Task-number: QTBUG-43026
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
QFontEngine_FT: Don't check for null after dereferencing.

Must have been a copy paste mistake, the check is used in other places
to make sure we don't unlockFace() without a lockFace(), but here
we're certain lockFace() was called first.

Makes Coverity happy.

Change-Id: I679129727b29a40d780f4fa903f44f7cbc9ec8cf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>