Results 1 to 2 of 2

Thread: QGraphicsScene:drawForegroud(...) question

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QGraphicsScene:drawForegroud(...) question

    Hi,

    I have drawn a complex map in the background of the QGraphicsScene object. Now I want to draw some additional pixmaps in the foreground of that scene object and update a given rectangle(using invalidate(..) method). It's ok, but the foreground(whole scene foreground) is updated everytime I move a cursor on that scene. Howto force the scene not to update the whole scene all the time?

    I would like to update only a rectangle, that has changed...etc.
    When I implemented the QGraphicsScene::drawForeground(...) and added a static int member, incremented it by 1 and used 'qDebug()<<' to show the value, qDebug is like in the loop. withing 10 sec x reaches 1000(when I move the mouse on the scene).

    I thaught that foreground is another layer and should react almost the same way as background( not redrawing while moving the mouse), but I suppose I am wrong. Could anyone explain the difference to me.


    THank you for any help.

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene:drawForegroud(...) question

    What about the exposed rectangle which is passed to you? Do you take it into account?

Similar Threads

  1. Access to QSqlTableModel::isDirty Question.
    By patrik08 in forum Qt Programming
    Replies: 3
    Last Post: 12th April 2007, 17:49
  2. Replies: 1
    Last Post: 15th March 2007, 20:45
  3. Question regarding how to paint after zoom.
    By JonathanForQT4 in forum Qt Programming
    Replies: 2
    Last Post: 26th January 2007, 15:34
  4. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38

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.