Results 1 to 2 of 2

Thread: Why the Qgraphicsscene has drawbackground event ?????

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Why the Qgraphicsscene has drawbackground event ?????

    This is the kind of things I dont understand.
    As you can read on reference :
    Note that QGraphicsScene has no visual appearance of its own; it only manages the items. You need to create a QGraphicsView widget to visualize the scene.
    But You have :
    void QGraphicsScene::drawBackground ( QPainter * painter, const QRectF & rect ) [virtual protected]
    Draws the background of the scene using painter, before any items and the foreground are drawn. Reimplement this function to provide a custom background for the scene.
    All painting is done in scene coordinates. The rect parameter is the exposed rectangle.
    If all you want is to define a color, texture, or gradient for the background, you can call setBackgroundBrush() instead.
    See also drawForeground() and drawItems().
    ??????
    Any explanation ?

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

    Default Re: Why the Qgraphicsscene has drawbackground event ?????

    Please download Qt sourcecode, unpack it and have a look at what QGraphicsView::drawBackground() and QGraphicsScene::drawBackground() look like.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 5th September 2012, 03:22
  2. Replies: 1
    Last Post: 30th October 2009, 08:52
  3. Mouse press event in a QGraphicsScene
    By Lykurg in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2009, 10:28
  4. QGraphicsScene drag event
    By rbp in forum Qt Programming
    Replies: 10
    Last Post: 13th May 2009, 14:03
  5. QGraphicsScene doesn't enter drag event
    By Radagast in forum Qt Programming
    Replies: 8
    Last Post: 16th June 2008, 17:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.