Results 1 to 4 of 4

Thread: creating widgets asynchronously

  1. #1

    Default creating widgets asynchronously

    Hi,

    My aim is to create widgets asynchronously.
    I tried using QFutureWatcher for doing this,but its complaining widgets should be created in same gui thread.Is there any way to do this

  2. #2
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: creating widgets asynchronously

    you could emit a signal with required parameters from your worker thread and write a slot in the gui thread which actually creates the widgets.
    Let your work talk for you

  3. #3

    Default Re: creating widgets asynchronously

    HI,

    I was getting this kind of warnings and errors

    QPixmap: It is not safe to use pixmaps outside the GUI thread

    ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file kernel\qwidget.cpp, line 1050

  4. #4
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: creating widgets asynchronously

    yes,
    I believe you are creating the widgets in the context of your worker thread. that is not allowed in Qt. All UI elements should be created only within the main GUI thread. so make such changes accordingly. like suggested previously, emit a signal from the worker thread and create the GUI elements in the main thread slot.

    cheers!
    Let your work talk for you

Similar Threads

  1. Upper limit on number of widgets?
    By jdiewald in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2008, 23:00
  2. Creating And Destoying composite Widgets
    By morraine in forum Newbie
    Replies: 3
    Last Post: 31st August 2008, 16:57
  3. Replies: 2
    Last Post: 16th May 2008, 14:39
  4. widgets behind hidden widgets not working
    By bpetty in forum Newbie
    Replies: 13
    Last Post: 7th September 2007, 20:23
  5. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37

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.