Results 1 to 19 of 19

Thread: Fast updation for controls in QT3

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Location
    Chennai
    Posts
    36
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Fast updation for controls in QT3

    I am using QT 3.3 for my application and updating near about 150 line edit boxes. The rate of updation is twice in a second, and this updation will continue for more than 30 minutes which showing some problems like -

    X Error: BadRequest (invalid request code or no such operation) 1
    Major opcode: 255
    Minor opcode: 0
    Resource id: 0x40035e



    MyApplication: Fatal IO error: client killed

    There is no delay between the updation of 2 line edits.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Fast updation for controls in QT3

    Do you use threads?

  3. #3
    Join Date
    Sep 2008
    Location
    Chennai
    Posts
    36
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Fast updation for controls in QT3

    Yes I'm using pthread, I'm passing the main window object (which having 150 line edits) to the thread, and updating the line edits from the threads.

    I have tried using QThread, which also showing the same issue.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Fast updation for controls in QT3

    Read this carefully: http://doc.trolltech.com/3.3/threads.html

    Especially the part that says you can't touch the GUI from a non-GUI thread.
    Last edited by jacek; 8th September 2008 at 14:05. Reason: fixed Qt version in the link

  5. #5
    Join Date
    Sep 2008
    Location
    Chennai
    Posts
    36
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Fast updation for controls in QT3

    I tried with the QThread also, which is not working. I am uploading the sample program, that I have done using QThread. Thanks in Advance .....
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Fast updation for controls in QT3

    Could you repeat my previous post with your own words?

  7. #7
    Join Date
    Sep 2008
    Location
    Chennai
    Posts
    36
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Fast updation for controls in QT3

    Thanks a lot for that the XLib problems are not coming for QThread. But a new problems arise, if I'm using (for the samples I've attached in my previous post) QThread the main window is not coming properly (It's getting hanged), in the document also I could not get any solution for this, can anybody help me ?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Fast updation for controls in QT3

    Quote Originally Posted by soumyadeep_pan View Post
    if I'm using (for the samples I've attached in my previous post) QThread the main window is not coming properly
    You can't mix threads and GUI.

  9. #9
    Join Date
    Sep 2008
    Location
    Chennai
    Posts
    36
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Fast updation for controls in QT3

    To my orginal problem, can I do parallel GUI updation in QT ? Is there any way to do parallel processing with continuous parallel updation GUI in QT? thanks in advance .

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Fast updation for controls in QT3

    Quote Originally Posted by soumyadeep_pan View Post
    To my orginal problem, can I do parallel GUI updation in QT ? Is there any way to do parallel processing with continuous parallel updation GUI in QT?
    You would know that if you read that document I've pointed you to. You can use threads for processing, but only the main thread can do anything with the GUI.

  11. #11
    Join Date
    Sep 2008
    Location
    Chennai
    Posts
    36
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Question Re: Fast updation for controls in QT3

    Quote Originally Posted by jacek View Post
    only the main thread can do anything with the GUI.
    What do you mean by a main thread ? Can I do any semaphore post to that thread ?

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.