Do not print a warning for the serialport closure if it is not open

This is necessary because end users will get a warning needlessly if the serial
port is not open when using the library.

There are two alternatives:

* Close in the destructor only if it is open.
* Do not print a warning.

The latter approach is more consistent with the other QIODevice subclasses, so
it is better to stick to that for now.

Change-Id: I918c203b1f5c52fba20de1373c298b8527a0e5a1
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Revert the incompatible qwineventnotifier.h for Qt4

The change

* 50ab4d4a8ff5f882b9699cbde26ad9d8824a4824

sync'd up the header file in question with the updates, but those
changes are incompatible with Qt4. This unfortunately means, a mix
has to be applied from both version.

Tested on Windows with Qt4 (MinGW).

Change-Id: I0468c03ccfb276096cfc3adf80bfc0b3488c81f2
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Add the Q_OBJECT macro to the notifiers

The notifiers are derived from QObject and shall have the Q_OBJECT
macro.

Tested the build on Windows, Windows CE, Android with Qt4 and then Qt5.

Change-Id: Ie860a02cb5e73b9af62e0f0b5de379e34c077c0e
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Replace the reinterpret_cast to qobject_cast for the QObject's

Change-Id: I883838a264345a6b3a1d73725f1385981513870b
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Do not call CancelIo() in the AbstractOverlappedEventNotifier destructor

This function is used for "CreateFile" calls as opposed to "CreateEvent".
Hence, the usage has been erroneous in here.

See the MSDN links below for further details:

Overall: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363791%28v=vs.85%29.aspx

CreateFile: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx

CreateEvent: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682396%28v=vs.85%29.aspx

It is also observed with a bit of testing that CancelIo() returns
ERROR_INVALID_HANDLE for some reason. This has not been tracked down though,
so it may be red-herring.

Change-Id: Ic2aea712763907dd9c9a32169702fa06308a7ee8
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Remove qFind usage from QSerialPortPrivate

qFind is deprecated by now. See discussion at
http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I18f5be8e803af645df21d47c41d820b8f7fecfa7
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I86357ba67c2314bf423f28bd4137c70bf3cfaf43