Results 1 to 3 of 3

Thread: Problem with screen update...

  1. #1
    Join Date
    Jan 2006
    Posts
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Problem with screen update...

    hi
    i have written a module to send a file to the printer. The program works like:

    //Pseodu
    int i=0;
    while(!eof(fptr){
    ReadBuff(fptr,Buff,SIZE);
    WriteToPrintf(Buff,SIZE);
    ProgressBarUpdate(i);
    i+=IncrementValue;
    }

    The file size is approx 4000bytes. The problem is while executing the above loop, the table which is displayed on the screen, the data disappears and screen seems to be frezzed. However, when the above operation is finished, the screen returns to normal.

    Also, i want the progressbar to show the current status but the progressbar appears only after the entire contents are sent, showing directly 100%

    i m using QT3.3.4

    What can be the problem and possible remedies...

    thanking in advance....

  2. #2
    Join Date
    Jan 2006
    Location
    Germany - Mannheim
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with screen update...

    This sounds like you are doing all the "work" inside the eventloop of your dialog.
    So the dialog is busy by looping and doing the work and can't update itself.
    I would sugguest to move the code which is doing the work to a separate thread.
    Last edited by Timewarp; 27th January 2006 at 20:30.

  3. #3
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with screen update...

    Qt Code:
    1. //Pseodu
    2. int i=0;
    3. while(!eof(fptr){
    4. ReadBuff(fptr,Buff,SIZE);
    5. WriteToPrintf(Buff,SIZE);
    6. ProgressBarUpdate(i);
    7. qApp->processEvents(); // This will make your app responcive
    8. i+=IncrementValue;
    9. }
    To copy to clipboard, switch view to plain text mode 
    Kepp SIZE small.
    But moving it to a new thread is the best solution.

Similar Threads

  1. On Screen Keyboard Problem
    By cutie.monkey in forum Qt Programming
    Replies: 1
    Last Post: 16th July 2008, 14:28
  2. QProcess-startDetached and Console screen problem
    By ramazangirgin in forum Qt Programming
    Replies: 1
    Last Post: 17th June 2008, 09:05
  3. Replies: 1
    Last Post: 26th December 2007, 11:58
  4. QSlider Update Problem
    By December in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2006, 05:02
  5. hide/show screen update problem
    By SkripT in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2006, 18:49

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.