Doc: Clean up threading examples

- Example 3 (Clock) is a collection of anti-patterns.
    - It implements a slot in a QThread subclass and then forces the new
      thread to use Qt::DirectConnection to invoke the slot in the
      "wrong" thread.
    - It talks about getting away with non-thread-safe usage
    - It uses a thread as a timer and then admits that it's an over-
      complicated approach.
- Example 4 (Permanent Thread) is over-complicated yet incomplete. A
  better one exists in the QThread class ref.
- Example 1 (Thread Pool) is covered by the QThreadPool class ref.
- Example 2 (QtConcurrent::run()) is covered in the "Threading and
  Concurrent Programming Examples" page and the "QtConcurrentRun" page.
- The undocumented "Hello Thread" example is covered in the QThread
  class ref.
- These examples cannot be accessed from Qt Creator's Examples tool.
- These examples are neither widget-related nor tutorials, contrary to
  their source paths.

Task-number: QTBUG-33360
Change-Id: Ic79cb764ee925ddbcbeafee8e1d01db7fe0f6cfe
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Doc: Fix broken links

Task-number: QTBUG-33360

Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Add qcollator_p.h to the list of headers.

Change-Id: I91963843e10fe0c33e5f13c06562dc5f9fdc2b6d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Make error messages a bit better.

Change-Id: I83b5852abfbb3437c03516bc4b36eff385ddb983
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
BlackBerry: Prevent superfluous removal of socket notifiers

File descriptors have always been removed from bps before adding them,
which lead to an annoying warning.
"QEventDispatcherUNIX::registerSocketNotifier()" needs to be called
after "ioEvents()" to prevent this.

Task-number: QTBUG-34536
Change-Id: If074ff7a6638fe234abc100c81d094e182de7537
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
QLineEdit: Fix potential crash when removing the clear button.

Remove it from the side actions list.

Task-number: QTBUG-34315
Change-Id: I70063351193b504f8656e903896d155ac74f73a6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Disable clear button in read-only QLineEdit.

Task-number: QTBUG-34315
Change-Id: I6c318879aee907c080e871a541da4ba5eadd71ed
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Process screen events in the main thread

Screen events are still read in the screen event thread but are
processed in the main thread to make it possible to support
QAbstractNativeEventFilter for screen events later.

Implementation is similar to the xcb platform plugin.

Change-Id: I7bade3e13e51c6d70bb608727a93bbd3aabc5d47
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Clarify use of Q_INIT_RESOURCE

The Q_INIT_RESOURCE macro is needed if a library itself uses resources, in
which case the Q_INIT_RESOURCE can and should happen in the library (like
we do for eg. widget styles), or if a library exposes resources that are
supposed to be used by the library clients, in which case the macro needs
to be put in the application code.

The distinction between the two, and the fact that resources built as part
of the main executable do not need the explicit initialization, were not
all that clear.

This was evident by the lack of Q_INIT_RESOURCE in our own Qt libraries,
and the various Q_INIT_RESOURCE calls in our examples where they are not
needed.

Change-Id: I40258458e9fdf9ee5502c212971fb3d90b4fc388
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
iOS: Enable threaded OpenGL.

This change activates ThreadedOpenGL and ThreadedPixmaps capabilities
in the iOS integration. QIOSContext is expanded with a support for
a shared context.

Change-Id: I56615c870a24e17850ad2748421c54e015de3ab2
Reviewed-by: Ian Dean <ian@mediator-software.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Clean up QWindowsSessionManager.

Fix spelling error in method name and inline simple functions.

Change-Id: I7f2a67fb1951b58874b09002ee57e15e75561727
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
qdoc: Eliminate qobject_cast() collision

Two template functions for qboject_cast() are defined
in qwidget.h that confuse qdoc because qdoc doesn't
handle template functions correctly. In this case, the
documentation for all qobject_cast() functions appears
in qobject.cpp where it is declared to be related to
QObject. This fix surrounds the template functions in
qwidget.h with #ifndef Q_QDOC ... #endif, since qdoc doesn't
need to see them.

This fix unmasks a linking bug QTBUG-34564, which will
be fixed separately.

Task-number: QTBUG-34505
Change-Id: I97fd32cc563bfa4a232819c097f41be56adf0114
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Remove Q_INIT_RESOURCE_EXTERN

It's not providing any convenience over using Q_INIT_RESOURCE, which does
its own extern, were never documented, and was added back in 2010 without
any commit message justifying its existence.

Change-Id: I1ca9a042d3f4fca34007d28b140661c50064f11b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Resolve Qt module deps before determining if QML import scanner is needed

The qtAddModules functions resolves deps internally, but doesn't affect
the original QT and QT_PRIVATE variables. We need to pick up situations
such as the user adding QT += quick, which implies QT += qml through
the QtQuick module's dependecies.

Change-Id: I14411dbea3e4f7402be404073a3fe8f18dbb165f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Disallow deep or widely nested entity references.

Nested references with a depth of 2 or greater will fail. References
that partially expand to greater than 1024 characters will also fail.

Change-Id: Id4e49d6f7cf51e3a247efdb4c6c7c9bd9b223f6e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Test exceptions in signals and slots

Only DirectConnection is tested

Change-Id: I525c6a65428489c34e58d1d9600b4e5ebda733b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Test that QMetaObject::invokeMethod is exception safe

Change-Id: Ie4662b7e475dc3d1ce9f36e8219361d9507622b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Fix placeholder text in QTextBrowser

Task-number: QTBUG-34051
Change-Id: Ief55cda861ef293a5fdeb2e5fa287b835c729894
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Improve documentation of QImageIOPlugin

Expanded the documentation to describe what the code in QImageReader and
QImageWriter actually expects from these plugins.

Change-Id: I04bb0cbf56d57a56ed246e723e533d73440a4d3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Cocoa: Don't hide views when reparenting

Commit a2bdda8e3ba32 was meant for creation only. We should not
hide views on our own, particularly when Qt had not asked for that.

Task-number: QTBUG-33581
Change-Id: Ib35fc78a27be1498f80aabd385e7a2185475b949
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>