Results 1 to 2 of 2

Thread: QApplication: GUIServer and GUIClient.

  1. #1
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QApplication: GUIServer and GUIClient.

    Hi.

    In a previous thread I've asked for some doubts about the Qt plugin system. My needs are to realize a Qtopia/QtExtended-style embedded system.

    I have a server application (derived from QApplication with GuiServer flag), with its main entry-point function.

    Now I'm trying to understand how can I run third-party applications from my server. Is the plugin system the best solution or should I use QApplication instances with GuiClient flag?

    In the second case, is this base layout correct?

    Qt Code:
    1. class pkServer : public QApplication
    2. {
    3. // It inherits from QApplication with GuiServer flag.
    4. }
    5.  
    6. class pkApplication : public QApplication
    7. {
    8. // It inherits from QApplication with GuiClient flag.
    9. }
    10.  
    11. int main(int argc, char **argv)
    12. {
    13. pkServer srv(argc, argv);
    14.  
    15. if (srv.startUp()) {
    16.  
    17. pkApplication client(argc, argv);
    18. client.startUp() // The client app shows its widgets here.
    19.  
    20. // ...other clients here...
    21.  
    22. return pkServer::exec();
    23. }
    24.  
    25. return pkServer::StartupFailure;
    26. }
    To copy to clipboard, switch view to plain text mode 

    Thanks for your answers!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: QApplication: GUIServer and GUIClient.

    You can't have more than one QApplication instance in your application. You can either treat "client apps" as separate processes and start them with QProcess or load them as plugins and execute a defined method from their interface. They will use your application object as theirs and build upon it. It gives more control but less stability than separate processes.
    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. The following user says thank you to wysota for this useful post:

    zuck (20th March 2009)

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.