Results 1 to 3 of 3

Thread: QPainter

  1. #1
    Join Date
    Feb 2006
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPainter

    Sorry for another thread.

    Buy my program has been behaving oddly since I got it running with QT 4.1.1

    Ok so basically it's getting the position of a bunch of label objects and drawing lines between certain ones. Now on my other computer with earlier QT4.1.0 when you dragged and moved a label the lines updated correctly to the new positions. Now they don't the old lines stay in place rather than going and only little bits of the new lines are occasionaly drawn.

    Oh and throught the use of iostream the coordinates it's trying to connect are defintly changing correctly.

    I've not changed the code at all in between so I'm a bit lost.

    Qt Code:
    1. void TreeDrawWidget::paintEvent(QPaint * event)
    2. {
    3. QPainter paint(this);
    4. paint.setPen(Qt::Black);
    5. for(int i=0; i<labels->size();i++)
    6. {
    7. QVector<DragTree*> listOfEdges = labels->value(i)->getEdges();
    8. for(int j = 0; j<listOfEdges.size();j++)
    9. paint.drawLine(labels->value(i)->pos(),listOfEdges.value(j)->pos());
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPainter

    Hi, sorry for the bump.

    But I've been over this somewhat and can't see a single difference. So what changed between 4.1.0 and 4.1.1?

  3. #3
    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: QPainter

    Are the coords of the lines updated correctly? Could you verify that?

Similar Threads

  1. QPainter reuse within a paintEvent
    By Micawber in forum Qt Programming
    Replies: 2
    Last Post: 2nd May 2008, 16:51
  2. QPainter update()
    By csvivek in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2008, 09:42
  3. QPainter
    By phil_ in forum Newbie
    Replies: 5
    Last Post: 16th December 2006, 19:54
  4. QPainter and QImage
    By beerkg in forum Newbie
    Replies: 3
    Last Post: 7th September 2006, 14:48
  5. Replies: 7
    Last Post: 20th March 2006, 20:03

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.