Fixing idlestate if used with synchronous transport

If QtWebChannel is used with a synchronous transport it can
happen that the clients idle state is wrong because the clients
idle message is received before the idle state is set to
'false'.
This patch changes the order of setting the idle state and
broadcasting the property update message to avoid that problem.

Change-Id: I7762b5279febb99d3cb2e110ec9306596fc71e14
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Doc: Fix example documentation and paths

To fix issues related to example documentation and to follow Qt
convention, do the following changes:
    - Rename examples/qwebchannel to examples/webchannel
    - Move example-specific documentation to correct location(s)
    - Include generic 'Running the Example' instructions
    - Add the module name to example title, fix links

This ensures that example docs are built and the example manifest
file generated correctly.

Change-Id: I284e0b13db95a6738d72258735018b59156cc7da
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Remove unused #include statement

Change-Id: Ic51555b34823354092a5a4e8583c51d50a1aded8
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Doc: Enabled linking to qtdoc.

-added 'qtdoc' to the depends variables in
qtwebchannel.qdocconf file

Task-number: QTBUG-40756
Change-Id: Ida3e1aa1237bcd91f0280d1969c2361f4ee70405
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Remove the extra semi-colons

qwebchannel.h:60:101: error: extra ‘;’ [-Wpedantic]

Change-Id: I7623b68ace59431266ca6a48bfa23bc306363e7e
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Fixing property update for wrapped objects

Returned QObject pointer got wrapped correctly but
a wrong QJsonObject was given to initializePropertyUpdates()
method.

Change-Id: I157b862ba2a90e87c295beb3c02fff932aac83c6
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Doc: Add extensions used by example files to .qdocconf

As the examples include files with extension that are not
included in the global Qt documentation config, add them
to the module's .qdocconf to get the files listed in the
example documentation pages.

Change-Id: Ifc3bf473b67d6acc795ce3f951f0c5269d69b69c
Task-number: QTBUG-40831
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Doc: Edited links JavaScript API page and other documentation fixes.

The JavaScript API page is important to the rest of the documentation
but there was no link to it.

Task-number: QTBUG-40756
Change-Id: Id741a67ac2b57e21da548c2961c622c7516ac8cf
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Get rid of setTimeout calls in qwebchannel.js client code.

This was a historic artefact which should not be required anymore.
Back then it was added when trying to improve the perceived performance
of the webchannel on an embedded device. Nowadays, using the built-in
WebKit IPC mechanism instead of WebSockets, paired with the rest of
the code cleanup and other changes, it should not be required anymore.

Change-Id: I4b2d76d84aaf92e12592a0b2bcf94710b697846e
Reviewed-by: Lutz Schönemann <lutz.schoenemann@basyskom.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Update license headers and add new licenses

- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Furthermore we need to update the sync.profile to not
point to the dev branch in order to integrate
this patch in the CI.

Change-Id: I06b5496b5d865e2da4808532362616429c969658
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Fixing failing testcases

Some testcases do not consider all messages. These changes make
the test wait at specific points until these messages are sent.

Change-Id: Ie8f4b9492fefade0be91e7f829824db39d61ddee
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: Ibbab64e34150e1131fadf37f2e84a0a3f618974f
Added a generic node.js debug client as an example

qwclient can connect to any qwebchannel server using a websocket
transport. The service can then be used through a REPL.
It can, for instance, be used with the standalone example server.

Change-Id: Ie73d19b0376caf2fcf6ae02ec19a56e27bddfd33
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Fix: Delete objects even when no transport is available

The issue is that objects that get deleted will not be
removed from the internal lists.
This patch checks for destroyed signals in cases when
no transport is available (no connection established).

Change-Id: I384b9e9dc280887d41bbfa59476400e9d8b1199b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>