Revert "Logging: Don't use for loop in qCDebug macros"

The use of if {} else {} in the macro causes compiler warnings
about "ambiguous 'else'" if qCDebug is used in an if / else without brackets.

Revert to the for loop, but make the variable name less likely
to clash.

This reverts commit bab5f5873680aa3c5a22d94da112aafd2b0b53d3.

Task-number: QTBUG-36605
Change-Id: Ie4b075b63b83b7f8a2ad61437b7bf3e6a6c0177a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Exclude widgets without associated QWindow in QApplication::shouldQuit().

Task-number: QTBUG-35986

Change-Id: Ibeb425fe054af163b86b2142028b3ea744cb9820
Reviewed-by: David Faure <david.faure@kdab.com>
Add const overload for QLoggingCategory::operator()()

Change 85e57653 caused a compile error for code that does

  Q_DECLARE_LOGGING_CATEGORY(cat);
  //..
  qCDebug(cat()) << // ...

error: C3848: expression having type 'const QLoggingCategory' would lose
some const-volatile qualifiers in order to call 'QLoggingCategory
&QLoggingCategory::operator ()(void)'

This is a regression from Qt 5.2. Fix the error by adding a const version
of operator()().

Change-Id: I2fb04f2e155962adee0f98089fc5a159000bef56
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Android: Add enablers for listening to activity results

When you launch an activity through an intent,
data can be provided back from the activity when it has finished
using onActivityResult() in the activity which launched it.

This is okay for applications, since they can easily create their
own activities, but does not work for libraries that need to
use intents. There is no listener API for activity results which
allow external classes to eavesdrop.

In order to support launching intents from third-party or add-on
libraries, we provide a low-level way to hook into the activity
result event. The corresponding public API will be added to
QtAndroidExtras.

Change-Id: I89417f485e2c0e69028dcccc7c155788346a7417
Reviewed-by: Christian Stromme <christian.stromme@digia.com>