Results 1 to 5 of 5

Thread: drawBackground function.....

  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question drawBackground function.....

    I'd like to know how this function operate:

    void drawBackground(QPainter *painter, const QRectF &rect);

    I Know that this function is called when a repaint event is being.
    Now.....what kind of settings has the painter?
    How can I set them? and the rect?

    I also don't understand why the "scene->setBackgroundBrush()" doesn't work when the virtual function drawBackground() is reimplemented(in a scene or view subclass).....

    I'd also like to have some examples.....

    excuse me for my poor english, i hope that you can understand me!!! Thanks a lot.

  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: drawBackground function.....

    How about taking a look at documentation of QPainter, QRectF and QGraphicsScene::drawBackground()?

  3. #3
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Re: drawBackground function.....

    I forget to tell you that i saw a lot of times the reference........

  4. #4
    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: drawBackground function.....

    Do not look at it - read it

    I can only repeat what is written there especially that I don't know what exactly you want to know. Read the docs and when you have specific questions, ask them.

    As for the only specific (yet trivial) question I see:
    I also don't understand why the "scene->setBackgroundBrush()" doesn't work when the virtual function drawBackground() is reimplemented(in a scene or view subclass).....
    Because the background brush is used by the default implementation of drawBackground(), so when you reimplement it without calling the base class explicitely, it won't be used.

  5. #5
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Talking Re: drawBackground function.....



    the bakgroundbrush works if a call the base class
    Qt Code:
    1. QGraphicsScene::drawBackground(QPainter *painter, const QRectF &rect);
    To copy to clipboard, switch view to plain text mode 

    ...thx

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 15:22
  2. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 13:57
  3. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 18:33
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 07:13
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 13: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.