Results 1 to 5 of 5

Thread: How draw extra border on QGraphicsTextItem?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2006
    Posts
    788
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    49
    Thanked 48 Times in 46 Posts

    Default Re: How draw extra border on QGraphicsTextItem?

    I not make forward paint ..

    but now ony resize window display a correct border why?

    Qt Code:
    1. void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,QWidget *widget)
    2. {
    3. QPen pen;
    4. pen.setStyle( Qt::SolidLine );
    5. pen.setWidth( 2 );
    6. pen.setColor( option->palette.highlight().color() );
    7. /////scene()->clearSelection();
    8. ////prepareGeometryChange();
    9. painter->setPen( pen);
    10. painter->drawRect (-2,-2,GetInt("large") + 4,GetInt("hight") + 4);
    11. QGraphicsTextItem::paint(painter,option,widget);
    12. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

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.