Avoid extensive string lookup in QSignalSpy.

Change-Id: Ie676ad36033e2f8d9832313956cfde9179967483
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Remove unused private method from QSignalSpy.

Change-Id: I0b401b2f18aef573a63d77702dd78bd4469d9475
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Remove an useless assert.

Change-Id: Icf6f6234d6f090fe4928830783620e7255362293
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Make VectorBoolElements static properties const.

The elements should not be changeable.

Change-Id: I108cb42b1237cd61c4d8f2fbe13305fbbf4ef311
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
QAbstractProxyModel: Forward drop-related API.

Forward canDropMimeData() and dropMimeData() to the source model.

[ChangeLog][QtCore][QAbstractProxyModel] QAbstractProxyModel now
forwards the drop-related API.

Task-number: QTBUG-39549
Change-Id: Ib81fcec862586e4ecfb99b9e0f4eb1a16eace762
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Propagate source/flags of QMouseEvent to QGraphicsSceneMouseEvent.

It is useful to be able to detect synthesized mouse events
in GraphicsView as well.

[ChangeLog][QtWidgets][QGraphicsSceneMouseEvent] Accessors
for Qt::MouseEventSource and Qt::MouseEventFlags were added to
QGraphicsSceneMouseEvent to enable detection of
synthesized mouse events.

Task-number: QTBUG-39814
Change-Id: Ib5835fef1f484005f9b0fc86518ed32ea79cd80f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
winrt: Return correct value from QSysInfo::windowsVersion()

Task-number: QTBUG-38439
Change-Id: I26303d040cc4b958e6af90ea63e5b0d821e2bb74
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
winrt: Remove WP8.0 references from package manifest feature

Also, harmonize the qmake documentation.

Change-Id: I8722370f86982e33ccf97f631ae257c4c46cade2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
winrt: Add convenience macros for returning from HRESULT calls

Almost every native call in WinRT uses COM HRESULTS. Provide some
convenience macros for returning after failure.

Task-number: QTBUG-39407
Change-Id: Ia99b0acd771d53c52732f270e46dd6937538e131
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
winrt: Add convenience method for waiting on an async call

As most of the Windows Runtime API is asynchronous, we have used various
methods for blocking in the calling thread waiting for the operation to
complete. This introduces an inline method, QWinRTFunctions::await(),
which performs the wait in a consistent and safe manner.

Task-number: QTBUG-39407
Change-Id: I54cd0e178aa560891ab92bfc5e7a6553e60e01b2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
winrt: use ComPtr in network classes

This removes extra code and potential memory leaks by using smart
pointers instead of calling Release() directly.

Task-number: QTBUG-38115
Change-Id: If799d6948af8c3df3d0c1617742653b104087e3b
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
winrt: Clean up QWinRTCursor

- Remove WinRT types from the header
- Remove WP8.0 code paths
- Use convenience methods for HRESULT handling

Task-number: QTBUG-38115
Change-Id: I05e77d75a7975a783d0f0714e6bab014231a406c
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
winrt: Clean up QWinRTServices

- Remove WinRT types from the header
- Use ComPtr everywhere
- Use convenience methods for HRESULT and async operations

Task-number: QTBUG-38115
Change-Id: I540a3349612b98c45545c92b2cb6d21a34918b8f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
winrt: Clean up QWinRTScreen

- Remove WP8.0 code paths
- Remove WinRT types from header as much as possible
- Use ComPtr where appropriate
- Use COM convenience methods

Task-number: QTBUG-38115
Change-Id: Ib241c3e5107add255a48340f86ee5885f895ff83
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
winrt: Use native threading

Instead of using std::thread, use the WinRT ThreadPool to manage
threads. This allows for setting the scheduling priority, and provides
a path to enable XAML integration (which requires Qt run on a background
thread).

QThread::terminate() is still unsupported, and only the winmain thread
can be adopted due to the behavior of the thread pool when creating
tasks from the GUI thread. The associated tests are now skipped, and
all other QThread tests pass.

Task-number: QTBUG-31397
Change-Id: Ib512a328412e1dffecdc836bc39de3ccd37afa13
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
winrt: Refactor timer callbacks

With the previous solution, a thread pool timer callback fired
in the same thread as the dispatcher. Now that timers can be called
from the base thread pool, callbacks can come from alternate threads and
so the associated event dispatcher must be tracked. This change refactors
how timer info objects are created and tracked so that they can be
properly created/destroyed/queued inside the timer callbacks.

All QTimer tests pass.

Change-Id: I18a5573df2a8fa32d1982c61e665d5df664b6db0
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Introduce std::string conversion to QByteArray

Add conversion methods similar to those in QString to QByteArray. This
is often more useful than the QString version since std::string like
QByteArray are byte arrays.

[ChangeLog][QtCore][QByteArray] Added convenience methods to convert
directly to and from std::string.

Change-Id: I92c29d4bb1d9e06a667dd9cdd936970e2d272006
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Only define the MSVC C++11 feature macros in C++

Don't define them if qcompilerdetection.h was compiled in C mode.

Change-Id: I080b62ef7c68bb582e55e9e3a1dff4e6c1bb48bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Update MSVC compiler features according to testing

Looks like a few extra features have been supported for a while and we
had never noticed. That includes the C++98 template friends, C++11
extern templates and C++11 nullptr. They've been supported since at
least MSVC 2010, possibly even earlier, but I don't have MSVC 2008 to
test with.

Testing also indicates that MSVC 2012 and 2013 have a bug in their
support for the range for construct. The following code fails to
compile:

    for (int i : l)
        do { (void)0; } while (0);

    test.cpp(2) : error C2059: syntax error : '}'

Reported as https://connect.microsoft.com/VisualStudio/feedback/details/903999/c-11-range-for-construct-fails-to-compile-when-body-is-a-do-while-block

Change-Id: I5d0156f4c847c45fa1f6f5b9ee4ddbdacb8ab59b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
qdoc: Improve <title> element contents in HTML pages.

-applied logic to projects that set (or not set):
    -landing page
    -home page
    -version
-change would remove duplicate information and proper module names
 instead of "Title | QtModule 5.4", it would be "Title | Qt Module 5.4"
-tested on various projects:
    -Digia projects
    -Qt 5
    -Qt Creator

Change-Id: Ica7d5203d293910c98306f947bfee8454b9225d0
Reviewed-by: Martin Smith <martin.smith@digia.com>