Results 1 to 3 of 3

Thread: Use Events to update UI

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2016
    Posts
    5
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Use Events to update UI

    QtForumInfo.png

    This picture represents the class structure.

    frm => ui
    cls => a normal class

    So this is what happens :

    1) press a button on frmMain
    2) clsMainlogic does not really do something itself, but gives the task to clsCameraLogic (other classes are connected to clsMainlogic, but those are not relevant for my question)
    3) in clsCameraLogic a function is running some code, but it takes a long time

    alright , here is what my problem is:

    The function (in clsCameraLogic) takes quite some time to complete. To update the user on its progress, an event is used to update frmLogger.

    Now, I know that you can't just update an ui from another thread. So my question : how do I do it?

    To complete the cycle:

    4) an event from clsCameraLogic with a string is given to clsMainlogic
    5) clsMainLogic gives the same data to frmMain
    6) frmMain, owner of the frmLogger object, calls a function in frmLogger to update the text in a label

    Step 1 to 6 work, the data reaches frmLogger, but it is not updated.

    I used the events native to c++, __hook and __unhook .
    Attached Images Attached Images

Similar Threads

  1. QGraphicsItem::update(); vs scene()->update();
    By Lord_Navro in forum Newbie
    Replies: 1
    Last Post: 25th April 2013, 06:23
  2. QFileSystemModel - Incremental update/pre-emptive update
    By johnnyturbo3 in forum Qt Programming
    Replies: 0
    Last Post: 2nd September 2011, 13:56
  3. Replies: 2
    Last Post: 29th September 2010, 17:44
  4. Events
    By T0bi4s in forum Newbie
    Replies: 16
    Last Post: 25th November 2009, 22:09
  5. Events
    By SV in forum Qt Programming
    Replies: 0
    Last Post: 21st May 2008, 08:48

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
  •  
Qt is a trademark of The Qt Company.