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. Bug when attempting embedding widget in container with thread

Bug when attempting embedding widget in container with thread

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 202 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.
  • W Offline
    W Offline
    walle19
    wrote on 6 Mar 2021, 10:23 last edited by
    #1

    Hi All,
    I am currently working on project in which I embed an external application in a QX11EmbedContainer object. The method I use is as follows:

    int embedAppInContainer(std::string& windowHint, QX11EmbedContainer* container, time_t timeout) {
        int winID = pollWIndowID(windowHint, timeout)
        if (FAIL != winID) {
            container->embedClient(winID)
            return SUCCESS
        }
    }
    

    This method works fine when performed on the main thread with no errors and the application gets embedded as intended.

    When I pass this method to a boost::thread things get unstable :
    Most times I execute the application I get the following error - Fatal IO error: client killed - and the app crashes and generates a core file that shows the following backtrace:

    #0 raise in libc-2.19.so
    #1 abort in libc-2.19.so
    #2 __libc_message in libc-2.19.so
    #3 _int_free in libc-2.19.so
    #4 _XReply in libX11.so.6
    #5 XQueryTree in libX11.so.6
    #6 embedClient in libQtGui.so.4
    #7 embedAppInContainer in libcontroller.so
    #8 thread_proxy in libboost_thread.so.1.59.0
    #9 start_thread in libpthread-2.19.so
    #10 __clone in libc-2.19.so
    

    Every few execution the method suddenly works fine and the error doesn't occur.

    Any insights will be much appreciated.
    Thanks

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 6 Mar 2021, 10:48 last edited by
      #2

      You must not do anything in the gui outside the main gui thread!

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      W 1 Reply Last reply 7 Mar 2021, 19:42
      4
      • C Christian Ehrlicher
        6 Mar 2021, 10:48

        You must not do anything in the gui outside the main gui thread!

        W Offline
        W Offline
        walle19
        wrote on 7 Mar 2021, 19:42 last edited by
        #3

        @Christian-Ehrlicher Understood. Thanks for your reply

        1 Reply Last reply
        0

        1/3

        6 Mar 2021, 10:23

        • Login

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