Fix use uninitialized, detected by GCC 4.8

If the widget \a field is not present on this form, getWidgetPosition
might not fill in the role variable. GCC is correct.

qformlayout.cpp:1690:19: error: ‘role’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Change-Id: Ia67991a71e8f1ceacb9d6370c7028c454ef630c6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Atomics: implement fetchAndSub on top of fetchAndAdd

Instead of looping unnecessarily on top of testAndSet.

Task-number: QTBUG-37031
Change-Id: I8120f8405eb76dccc9066749cee0a92b0f2da20e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Remove deleted QNetworkReplies from SPDY queues

We already remove QNetworkReply from most queues, but we also need
to remove it from the SPDY queue. Otherwise we might end up trying
to send an already deleted message.

Change-Id: Ib39bf8f26315b66179755a6f66dbd657576cbbe3
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Remove the header precompilation for QtXml and QtOpenGLExtensions

Respectively, those modules have 2 and 1 source files. Precompilation costs
more than the benefit of using precompiled headers.

Change-Id: I15ababd9ba7cce2e1510454da49010456ff0597a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
SPDY must handle destoyed QNetworkReply

A QNetworkReply may be deleted before it is closed by the protocol.
Since QSpdyProtocolHandler tracks pointers to QNetworkReplies it must
keep track of their destruction as well to avoid links to deleted
objects.

This fixes the last issue with SPDY access of Google Mail in QtWebKit.

Change-Id: I2c56dc080fdcb249b6ed9189fef84cbbc1220cbd
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Cocoa: Use helper class for event handling in native windows

QNSWindow and QNSPanel duplicate some code when it comes to event
handling, which can be refactored. Also, it's currently not
possible to keep an NSWindow derived instance temporarily alive
as QCocoaWindow is not designed to keep track of more than one
NSWindow. Finally, we can reduce the size of (and eventually remove)
the QCocoaWindowCategory which polutes the NSWindow namespace.

We move QNSWindow and QNSPanel specific API into QNSWindowProtocol,
and define QCocoaNSWindow as NSWindow extended by that protocol.
This gives us a type we can refer to any of the native windows
QCocoaWindow instanciates.

We introduce QNSWindowHelper which gathers the common code between
QNSWindow and QNSPanel. This is a one-to-one mapping that keeps a
weak (non-retaining) reference to the NSWindow and a weak reference
to the QCocoaWindow. It has the same life span as its associated
NSWindow.

Task-number: QTBUG-33082
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Change-Id: I38d001bf13f64a1ba4f1439291c5103c3f755183
Reviewed-by: Liang Qi <liang.qi@digia.com>
Cocoa: Keep child NSWindow alive while it grabs the mouse

Otherwise, Cocoa loses sight on which window to send the
dragging mouse event. If the window is kept alive (but hidden)
Cocoa will send the events to it, and we can forward them to
the actual QWindow.

This is the expected use-case:

  1. Start dragging a QWindow and change its flags.
  2. This triggers a call to QCocoaWindow::recreateWindow(),
     which will get rid of the old NSWindow and create a new
     one (the QNSView is moved to the new NSWindow).
  3. When we stop dragging, the NSWindow is finally destroyed.

QNSView Pointer References Remarks:

In QNSView, m_window points to the QWindow which remains unchanged
until deleted. Similarly m_platformWindow remains valid until
deleted, in which case we delete the QNSView, the NSWindow and its
helper (see QCocoaWindow destructor).

This fixes undocking QToolBars when they are a child NSWindow.

Task-number: QTBUG-33082
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Change-Id: I6fc53292cd96586cfdf401481c5442d759f1fae5
Reviewed-by: Liang Qi <liang.qi@digia.com>
Windows Vista Style: Don't draw menubar item background for QQ Controls

In QtQuick Controls, we draw the full menubar background and the menubar
items on top. Unless in a particular state, there's no need to draw the
background or it may overlap with the menubar edge.

Change-Id: Ia35a73274cc10b3b5a3f55573c92919f99555db0
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Turn off compiler optimization in tst_qtendian for MSVC2008.

This causes frequent compiler errors on Windows CE.

tests\auto\corelib\global\qtendian\tst_qtendian.cpp(140) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'd:\orcas\compiler\utc\src\P2\main.c[0xCCCCCCCC:0xCCCCCCCC]', line 243)

Task-number: QTBUG-37194

Change-Id: I2adbc1e3b1896fbe86780aa26a15e918333a09f2
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Win32: define _HAS_EXCEPTIONS as 0 when exceptions are off.

When this macro is not defined, a number of inline methods in the MSVC
stl will throw exceptions. This in turn generates a warning when
exceptions are not enabled on the compiler command-line.

Change-Id: I5a57ec544bda0c75f04fdea9412b03107f9ff531
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Doc: fix documentation of QProgressDialog::open

The slot is connected to the canceled() signal and not to the
accepted() signal since the introduction of the open method.

Task-number: QTBUG-37210
Change-Id: I0604c612f6054611a69876d53908bb58ec048b09
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Doc: fix Q_ASSERT example

Task-number: QTBUG-37162
Change-Id: Ifef8a976d29125251d7d87028c29deee4353e10a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Android: Add commercial license to BSD-licensed files

These files should also be usable under the commercial license
terms as an alternative to the BSD license.

Change-Id: If211bb63789722f655843831073ed05ee69811ea
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Revert "Propagate synthesized mouse events in parallel (lock-step) with touch"

This reverts commit 7808ec795c5831d56dae9c4f9f7e1306489864aa.

The commit interferes with the mouse event synthesizing which
was introduced in e50416066cab4be7df8382bd224d9e4ddd7a903a, and
which claims to solve the same original problem: Synthesizing mouse
events should be moved out from the platform plugin.

The issue with 7808ec795c5831d56dae9c4f9f7e1306489864aa is that
mouse events which are stolen by event filters will never get
composed double click events (this is done in the QGuiApplication
code), so double clicking on item views does not work with
synthesized mouse events. This makes e.g.directory pickers
unusable on a touch display.

The test cases introduced in the original patch still pass.

Task-number: QTBUG-36974
Change-Id: I0ec7c65d2a77589e60408623c2c0b20d427f0cfa
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Disable 'gsub' table check for AAT fonts on Mac

In AAT fonts, 'gsub' table is effectively replaced by 'mort'/'morx' table.

Change-Id: Ifa044c8e28c3f2aab0f57ba5e3e6b99ada84d37c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Doc: fix documentation for QGraphicsScene::focusItemChanged()

The name was misspelled in \fn.

Change-Id: I09824b72423b116612ee6e1069793de95d76f883
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Doc: fix warning: No documentation for 'QApplication::palette()'

Hide the forwarder function from QDoc.

Change-Id: I2ea5cce0e68a5803cd4a24cefbbd50fc6c5ffb94
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Remove use of templates in tst_qatomicinteger.

MSVC 2008 is confused by TypeInStruct being a template, resulting in

\tst_qatomicinteger.cpp(189) : error C2027: use of undefined type 'QStaticAssertFailure<Test>'
        with
        [
            Test=false
        ]

for int (and thus for all unsupported types). This appears to be a real
Heisenbug-nature compiler bug as it can also be fixed by adding
qDebug() << Q_ALIGNOF(TypeInStruct<T>)
before the static assert.

Task-number: QTBUG-37195

Change-Id: Ib2b60f3c1ffeb0b8bdeb1fb0c659655ce4ab10d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Support QQuickWidget on Windows.

Task-number: QTBUG-36887

Change-Id: Ifb03804e21fd82d7eae2942b9e8ca83f1bdb776c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
xcb: Rename main.cpp to xcbmain.cpp

Files with same base name cause extra trouble for debuggers.
It can be avoided here.

Change-Id: I1b7a6f28ac41bacbfd2603feb8b786c31d3769e3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>