Results 1 to 4 of 4

Thread: How to interface between Qt/C++ and a remote Qt Quick GUI

  1. #1
    Join Date
    Oct 2011
    Posts
    35
    Thanked 9 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default How to interface between Qt/C++ and a remote Qt Quick GUI

    Hi,

    I'm working on an application that will communicate over a network. On the client side, I'd like to deploy a minimal Qt Quick GUI. I plan to write the server side in Qt/C++. As with most non-trivial Qt Quick applications, I'd like to expose some C++ functionality to the QML side; I imagine I'd probably do this by making a call to setContextProperty. The question I have is how would one go about implementing this? Is the Qt Quick engine network-aware in the sense that it knows to make callbacks over the network to a C++ object that resides on another machine?

    Any direction/suggestions are appreciated.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to interface between Qt/C++ and a remote Qt Quick GUI

    You need to go over some protocol. Qt Quick can use http so if you expose a webservice, the GUI should cooperate with it. Otherwise you'll need to implement the communication in C++.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2011
    Posts
    35
    Thanked 9 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to interface between Qt/C++ and a remote Qt Quick GUI

    Thanks wysota. Would you be able to provide a really basic code example of how this can be done? What specific Qt classes and/or QML elements would I use to accomplish this?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to interface between Qt/C++ and a remote Qt Quick GUI

    On QML side most probably XMLListModel, on C++ client side probably QNetworkAccessManager, on C++ server side most probably QTcpServer and QTcpSocket.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt Quick QML
    By Brandon_R in forum Qt Quick
    Replies: 1
    Last Post: 17th August 2011, 18:21
  2. qt quick plugin.
    By wookoon in forum Qt Quick
    Replies: 1
    Last Post: 22nd April 2011, 09:18
  3. plugin for qt quick.
    By wookoon in forum Newbie
    Replies: 0
    Last Post: 17th March 2011, 06:31
  4. Qt Quick: Playground Example v1.3
    By therohan in forum Qt Quick
    Replies: 0
    Last Post: 10th February 2011, 07:50
  5. Quick Help Needed with little App.
    By Sicko in forum Qt Programming
    Replies: 4
    Last Post: 19th December 2006, 10:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.