Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: mainwindow does not refresh

  1. #21
    Join Date
    Jan 2006
    Posts
    25
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: mainwindow does not refresh

    Indeed I was confused about the main thread and whether I had to create that or not, but it didn't work when I did not create a mainthread. I will remove this and start with the code you posted in the previous thread.

    I still get these "XLib: unexpected async reply" errors. I have the feeling that the thread is not ended well. The lengthy process is executed well, but if I execute something in MyMDIMainWindow, the program does not respond anymore. I do not start mij lengthy process in MyMDIMainWindow, but from a widget that is placed in one of the dockwindows of the MyMDIMainWindow. Is this a problem?
    I also do not delete the lengthyprocess thread. I probably should, but how? I post the ended thread event, but I never get in the customEvent function...
    Last edited by edb; 25th January 2006 at 08:15.

  2. #22
    Join Date
    Jan 2006
    Posts
    25
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: mainwindow does not refresh

    One problem solved! My mistake. I overloaded the customEvent function instead of overriding it! Now the customEvent function is reached!

    I used: customEvent(QEvent* e) instead of customEvent(QCustomEvent* e)

    Concerning the xlib errors: I still got them. I will now try and remove all GUI related aspects from my thread and see what this will do. I have the feeling that interacting with the GUI from the thread causes this problem....

  3. #23
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mainwindow does not refresh

    Quote Originally Posted by edb
    One problem solved! My mistake. I overloaded the customEvent function instead of overriding it! Now the customEvent function is reached!

    I used: customEvent(QEvent* e) instead of customEvent(QCustomEvent* e)
    Sorry- my mistake, my example was wrong. I'll correct it now.

    Concerning the xlib errors: I still got them. I will now try and remove all GUI related aspects from my thread and see what this will do. I have the feeling that interacting with the GUI from the thread causes this problem....
    Of course. You cannot interact with the GUI whatsoever from another thread. That is what the customEvent mechanism is for. This is stated in the 'Thread Support in Qt' documentation. Did you read it?

    http://doc.trolltech.com/3.3/threads.html

Similar Threads

  1. mainwindow modality
    By user in forum Qt Programming
    Replies: 0
    Last Post: 11th July 2008, 00:54
  2. Refresh the Mainwindow at run time
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 15th November 2007, 13:16
  3. Notifying Mainwindow of an event..
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2007, 21:29
  4. Replies: 1
    Last Post: 11th September 2007, 13:34
  5. Replies: 3
    Last Post: 23rd July 2006, 18:02

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.