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. Thread in qtbrowser application

Thread in qtbrowser application

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 750 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    sarahjohn
    wrote on last edited by
    #1

    Hi,
    I have a browser application in qt .I need to run a thread in parallel to the browser taking the screenshot of the browser and sent to another pc. I used to capture the frame of webpage by rendering the mainframe of the webpage to an image. For that i need to give an input to the the thread ie, webview ' s object .How can i give the pass the object to the thread.?

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi, First of all, you can't use GUI elements in a different thread then the main thread. One could consider to 'copy' the webview object, but then again, the copy of a QObject is forbidden because very simple, you can't copy children / parent relations.
      What I would try is to generate the QImage like you said and then pass it to the already running thread calling a 'send' slot in that Thread object. The slot should receive a copy of the image so be threadsafe.
      If that doesn't work, try to register a new type (Q_REGISTER_METATYPE) of a class (CAN'T BE A QOBJECT DERIVED CLASS as explained before) that holds all needed data to be transferred.

      Greetz, Jeroen

      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