Results 1 to 15 of 15

Thread: Problem with QScrollview and QPainter

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2006
    Location
    Hyderabad
    Posts
    69
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Problem with QScrollview and QPainter

    That would be better. Iam sending you again two files and the complete code. These are the files that iam sending:

    small.txt (that contains the small file for which small.gif is sent).
    large.txt ( that contains the large file for which large.gif is sent) and
    source.cpp ( where the code has been written).

    Note: The "/tmp/parsetext.txt " in the code at any time contains the file for which graph has to be generated. And sir, I have not changed the code as you said previously (reading the file in another method). I have tried that but I faced the same problem of over-writing for large files. Kindly take time to see this and help me in what ever way possible.

    Thanks alot for your co-operation.
    with regards,
    sarma.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with QScrollview and QPainter

    Ok, I think I might have found your problem. As far as I remember there exists a maximum size of a widget under X11. I don't remember the exact size, but it's probably around 64k (or less) and I see you are trying to obtain greater heights which probably causes an overflow of some variable resulting in y values being y = kount1 % maxheight.

    So having found the bug is one thing, but working it around is another. In your case, you can either switch to Qt4 (which, afair has a workaround for this) or make a fake scrollview. Instead of having a very big viewport, have a regular widget which will change its contents according to scrollbar values. Meaning you'll have to implement paintEvent in such a way, that is renders only a part of your chart which should currently be visible. You could also check if QCanvasView has the same limitations.

    A side effect will be that your widget should redraw much faster.
    Last edited by wysota; 6th March 2006 at 17:13.

  3. #3
    Join Date
    Mar 2006
    Location
    Hyderabad
    Posts
    69
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Problem with QScrollview and QPainter

    Sir,
    What you said might be correct. But Iam a novice in QtProgramming. So I don't know how to fix this problem . I shall be greatful to you if you help me in this regard.This is the only problem that Iam having since 3 weeks. Presently Iam trying it with QCanvasView.

    Thanks alot,
    Sarma.

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.