Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt depended library in native iOS app (main event loop question)
Forum Updated to NodeBB v4.3 + New Features

Qt depended library in native iOS app (main event loop question)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 382 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.
  • B Offline
    B Offline
    bludger
    wrote on 20 Dec 2016, 14:45 last edited by
    #1

    Hi All!

    Currently I'm working on a library which is heavily depended on Qt (networking part mainly). One of the goals is to share this lib among a variety of platforms including iOS. As I'm working towards the moment to bring all the components together I stumbled upon some issues regarding iOS and the lib. Main problem for now is that the lib needs a QCoreApplication (thus the Qt's event loop) and I'm not sure how to get that. Last days I read a lot regarding this and most of it seems to be out-dated / not relevant anymore. Problems arise because we use XCode for the native look and feel of the app, it also provides a main.m which initiates the UIApplicationMain.

    So, how can I get the QCoreApplication when the app already have a main loop provided by XCode (UIApplicationMain) or how can I replace it or attach to it?

    Subclassing QThread and initiate a QCoreApplication within the subclass won't work because Qt will complain about the fact it wasn't created in the main thread which is required by Qt. Note that the lib doesn't do anything with the Gui at all, it contains most of the BL like communicating with webservices etc.

    Thanks in advantage.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ad1170
      wrote on 22 Jan 2022, 09:12 last edited by
      #2

      Hi, do you have found a solution for this issue?
      I have the same problem an try to start a QCoreApplication in an other thread. On Android, it works even if the QCoreApplication does not run on the main thread.
      THX

      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