Results 1 to 20 of 46

Thread: Qpainter function on a QFrame problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #31
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Qpainter function on a QFrame problem

    I'm back with another very confusing problem.
    I have 2 versions of the same program. Call them A & B. I use
    Qt Code:
    1. void MyDrawingFrame::slotSetPaintItems ( QStringList list )
    2. {
    3. int n;
    4. for(n = 0; n < list.count(); ++n )
    5. {
    6. tempList = list[n].split("|"); /// split the list into types of stringLists
    7. k = tempList[0]; /// get the type of element to draw
    8. if(k == "erase") clearWindow = "erase";
    9. else
    10. {
    11. tempList.removeFirst(); /// remove the element with the code
    12. clearWindow = "false";
    13. if(k=="supports")
    14. paintSupportLines=tempList;
    15. else if(k=="columns")
    16. paintColumns=tempList;
    17. else if(k=="help")
    18. paintDrawHelpWindow=tempList;
    19. else if(k=="erase")
    20. clearWindow="true";
    21. }
    22. }
    23. emit getDrawingFrameSize (&W,&H);
    24. k = actionList.last();
    25. tempList = k.split(",");
    26. if(tempList[1] == "4") setGeometry (10,10,W ,H);
    27. else setGeometry (10,10,0,0);
    28. update();
    29. }
    To copy to clipboard, switch view to plain text mode 
    for both versions and as near as I can tell the same data. There are two stages. The first just displays the "support lines" and the second displays both the "support lines" and the "colums".(see attachments from version B) Version A is fine for just the support lines, but when trying to display both the program crashes with the following statement which I don't understand at all.
    { Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>:perator[]", "index out of range");
    detach(); return reinterpret_cast<Node *>(p.at(i))->t(); }
    I have replaced the "update" with "redraw" but same problem. I don't think the problem is in the "paint event" itself,

    As usual I would appreciate any help you can give me.
    thanks.
    Attached Images Attached Images

Similar Threads

  1. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  2. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  3. Problem emitting signal from a static function
    By Valheru in forum Qt Programming
    Replies: 21
    Last Post: 12th June 2007, 14:48
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

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.