Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt GUI on Shared Object
QtWS25 Last Chance

Qt GUI on Shared Object

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 844 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alexsho
    wrote on last edited by
    #1

    Hello,
    I'm working on Ubuntu Linux and trying to implement following configuration:
    Main non-Qt C++ project on Netbeans IDE, let's say proj. A, that loads another C++ shared object (B), which can perform some operations, and in some condition it can load Qt Shared library with GUI (C) and communicate with the GUI.
    So far i tried to start the Qt GUI object by opening new thread on (B), but it crashes when i'm trying to instanciate the QApplication.
    What is the correct way to implement such chain ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ckakman
      wrote on last edited by
      #2

      QApplication integrates with the underlying wşndowing system so that it can receive input events, update the UI etc. You should instantiate QApplication in the main thread and also call the the blocking QApplication::exec() if the user is supposed to interact with a custom UI. You can call QApplication::quit() when you are done with the QT-based UI component. Qt's UI classes based on QDialog can be used without calling QApplication::exec() (but you need to call QDİalog::exec in that case).

      To sum up, you need an event loop (QApplication/QDilaog::exec()) in the main thread so that Qt's UI classes can interact with windowing system.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved