Results 1 to 10 of 10

Thread: problem with paint and erase in frame

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    8

    Default Re: problem with paint and erase in frame

    thank you very much for your help .

    but the following error appeard when I run my application before I draw any thing and it appeard in many lines :

    ASSERT: "i <= nodes" in /usr/include/qt3/qvaluelist.h (373)

    I did not understand this error please help me

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

    Default Re: problem with paint and erase in frame

    You are trying to access the list with an index larger than the size of the list. Most probably because you are trying to redraw the widget when there is only one point on the list.

  3. #3
    Join Date
    Apr 2008
    Posts
    8

    Default Re: problem with paint and erase in frame

    Hello everyone ,,

    Thanks so much wysota for your replay ,,

    If you draw anything outside paintEvent() it will be lost when something obscures your widget. Restrict drawing to paintEvent() only.
    <<<this was my first problem ,, but the piece of code in my second replay sloves this problem (lossing data when another window come over the frame for writing )

    to clearly describe my problem ,, here is a brief description of it :
    I have a large project , but I have a problem in the interface ,, in my project I need a frame for writing on it ,, and and a button for erasing all what was written , and another button that acts as an eraser and of course a button for re-writing on the frame


    The problem is once I write on the frame and erase it ( using QWidget::erase())
    and another window come over my window ,, all what was erased before is draw on the frame unhappy



    for erasing all the frame I could use this peice of code and the prblem disappears , but I don't know how to do if I would only earase some of my drawing not every thing:

    Qt Code:
    1. void TextFrame :: EraseAll()
    2. {
    3. CounterOfPoint = 0 ;
    4.  
    5.  
    6. _buffer = *(QWidget::erasePixmap ());
    7.  
    8.  
    9. QWidget::setErasePixmap (_buffer) ;
    10.  
    11.  
    12.  
    13. }
    To copy to clipboard, switch view to plain text mode 

    could any one help me

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

    Default Re: problem with paint and erase in frame

    Still my answer remains valid - you shouldn't draw outside paintEvent(). If you do that, you're on your own - don't ask Qt for help.

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.