Results 1 to 4 of 4

Thread: Draw button(similer to QPushButton) using the QPainter.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Draw button(similer to QPushButton) using the QPainter.

    Quote Originally Posted by pastispast View Post
    - I am using resizing event for resizing the QGraphicsView:
    QGraphicsView::resizeEvent(event);
    fitInView(scene->sceneRect(), Qt::KeepAspectRatio);

    - But during the resize controls are not synchronize with the QGraphicsView.

    What can be the cause of this?
    What do you mean with synchronize? Do you mean that all the objects jump around?

    I have one more doubt that can I use QPainter drawing in "QGraphicsView".
    Sure, but it's pointless as the view is a container for items that are drawn on top of it.
    The correct way to do this is create a custom QGraphicsItem and implement the paint function. See the QGraphicsItem documentation.

  2. The following user says thank you to tbscope for this useful post:

    pastispast (24th July 2010)

Similar Threads

  1. Draw line on image using QPainter
    By Qt Coder in forum Qt Programming
    Replies: 29
    Last Post: 11th August 2015, 12:09
  2. QPainter performance for zooming and draw...
    By Programm3r in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2010, 10:29
  3. QPainter::drawText, draw big text
    By franco.amato in forum Newbie
    Replies: 3
    Last Post: 18th March 2010, 08:32
  4. QPainter doesn't seem to draw QImage
    By Denarius in forum Qt Programming
    Replies: 7
    Last Post: 3rd March 2009, 14:12
  5. QPainter draw rounded arrow
    By xgoan in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2006, 12:32

Tags for this Thread

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.