Results 1 to 19 of 19

Thread: Can't seem to get QGraphicsView to refresh

  1. #1
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Can't seem to get QGraphicsView to refresh

    I'm working on a puzzle game played on a hexagonal board. The main window is designed using QT Designer, and contains a QGraphicsView widget named viewFrame.

    The board on which the game is played is a class which inherits QGraphicsScene:
    Qt Code:
    1. class Xorbz_Board : public QGraphicsScene
    To copy to clipboard, switch view to plain text mode 
    All game pieces ("markers") are added to the scene as they are constructed.

    The scene is associated with the view during code initialization:
    Qt Code:
    1. viewFrame->setScene( (QGraphicsScene*)myBoard );
    To copy to clipboard, switch view to plain text mode 

    When the mouse moves over a marker, it should highlight it and available moves with a circle:
    Qt Code:
    1. void Xorbz_Marker::hoverEnterEvent( QGraphicsSceneHoverEvent* event )
    2. {
    3. ...
    4.  
    5. // On hoverEnter, highlight available moves
    6. highlights = new QGraphicsItemGroup( this, this->scene() );
    7. ...
    8.  
    9. // Highlight our current node
    10. e = new QGraphicsEllipseItem( s*n->locX(), s*n->locY(), s, s, highlights );
    11. e->setPen( QCOLOR_GREEN );
    12. e->setVisible( true );
    13. scene()->addItem( e );
    14.  
    15. // Highlight available moves
    16. ...
    17.  
    18. scene()->update();
    19. }
    To copy to clipboard, switch view to plain text mode 

    The highlights are subsequently deleted by the hoverLeave event.

    The problem: The view doesn't refresh to show the highlights. My animated graphics don't refresh either (unless I'm resizing the window), so I'm guessing I'm doing something incorrect in an obvious fashion, but I can't see it.

    I've set breakpoints in the hoverEnterEvent routine, and they do get hit when I move the mouse over the markers, so I know that the code is getting hit.

    So here's the question: After I add things to my scene, I invoke the scene's update() function, and that should be it, right? Or do I need to do something with the view too? I've read in places about reimplementing paint(), but is that requisite when using primitives exclusively?

    Thanks in advance!

  2. #2
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Quote Originally Posted by smahnken View Post
    I'm working on a puzzle game played on a hexagonal board. The main window is designed using QT Designer, and contains a QGraphicsView widget named viewFrame.

    The board on which the game is played is a class which inherits QGraphicsScene:
    Qt Code:
    1. class Xorbz_Board : public QGraphicsScene
    To copy to clipboard, switch view to plain text mode 
    All game pieces ("markers") are added to the scene as they are constructed.

    The scene is associated with the view during code initialization:
    Qt Code:
    1. viewFrame->setScene( (QGraphicsScene*)myBoard );
    To copy to clipboard, switch view to plain text mode 

    When the mouse moves over a marker, it should highlight it and available moves with a circle:
    Qt Code:
    1. void Xorbz_Marker::hoverEnterEvent( QGraphicsSceneHoverEvent* event )
    2. {
    3. ...
    4.  
    5. // On hoverEnter, highlight available moves
    6. highlights = new QGraphicsItemGroup( this, this->scene() );
    7. ...
    8.  
    9. // Highlight our current node
    10. e = new QGraphicsEllipseItem( s*n->locX(), s*n->locY(), s, s, highlights );
    11. e->setPen( QCOLOR_GREEN );
    12. e->setVisible( true );
    13. scene()->addItem( e );
    14.  
    15. // Highlight available moves
    16. ...
    17.  
    18. scene()->update();
    19. }
    To copy to clipboard, switch view to plain text mode 

    The highlights are subsequently deleted by the hoverLeave event.
    I assume Xorbz_Marker derives from QGraphicsItem or one of its subclasses?
    I can't see anything blatantly wrong with your code, but you are doing highlighting in a very strange way. I would just set a flag on hover, then call update() on the marker item and in the paint() funciton you can then draw the highlight on the item. Creating a new highlight item is not particularly efficient.

    You don't have to update the scene when adding an item, it should just work.. Might need to post some more code to see where the problem is.

  3. #3
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Xorbz_Marker derives from QGraphicsPixmapItem.

    I'll try your suggestion; it sure seems simpler. I just don't know the painter stuff very well.

  4. #4
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Smile Re: Can't seem to get QGraphicsView to refresh

    Hi I find that you update only the graphics scene ... but the graphic view is not updated ...

    Try updating the graphics view as soon as you make any change to the graphic scene ...

    It should work ....

    Regards
    -Ram

  5. #5
    Join Date
    Jan 2008
    Location
    Finland /Pakistan
    Posts
    216
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Quote Originally Posted by ram136682 View Post
    .. but the graphic view is not updated .....
    Regards
    -Ram
    I think this is not a good idea to update the whole view if there are many widgets/items in a scene then you shouldnt be updating the whole view..just update what you want ...

  6. #6
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Can't seem to get QGraphicsView to refresh

    Hi ,

    Update doesn't mean that you should update the whole view.

    You should try a combination of the signal
    void QGraphicsScene::changed ( const QList<QRectF> & region ) and the overloaded update function ( these update functions updates only the regions
    that are changed)

    Please check the following link

    http://doc.trolltech.com/4.4/qgraphi...e.html#changed

    Regards
    -Ram

  7. #7
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Quote Originally Posted by ram136682 View Post
    Hi ,

    Update doesn't mean that you should update the whole view.

    You should try a combination of the signal
    void QGraphicsScene::changed ( const QList<QRectF> & region ) and the overloaded update function ( these update functions updates only the regions
    that are changed)
    You don't need to do any of that. If the view is not updating, the problem lies somewhere else. If you add an item to the scene, the framework will update the views properly. If it isn't, there is something wrong, and hacking around with manually calling update and listening for change events is not the right way to do it.

    If we can see more code (compilable example is best) then we could diagnose further...

  8. #8
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Perhaps someone could clarify something for me. I read in the docs that update() schedules a refresh to run when control returns to the event loop. So one possibility that could exist is that I'm not returning to the event loop... However, if that was the case, I wouldn't be getting the hoverEnter and hoverLeave events, right? Hitting those is evidence that the event loop is running...?

    Regarding posting more code, the only question is what to post. The code base spans better than a couple dozen source files in addition to ui and such. The source .zip file is 2.4 MB. I had it functional using QT3, and I've been in the process of migrating it to QT4 native (no QT3 compatibility classes). Add to that the fact that I've been focusing on the *cough* Windows *cough* build, and I'm not sure how much interest anybody else will have in digging through the entire code base. Still, I'd appreciate the help if anyone wants to get their hands dirty.

  9. #9
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    More clues!

    So I think I've made a discovery that ought to be an "a-ha!" moment, but I'm missing something. Hopefully someone else will know the answer.

    So originally I was creating my QGraphicsView by including it in the UI designed using QT Designer, and then setting the scene during code initialization. On a whim, I decide to rip it out of the GUI design and create it dynamically during code initialization instead.

    I found that if I parent the QGraphicsView to my main window, I don't get scene refreshes. If, however, I construct it with a NULL parent (so it pops up in a separate window) I DO get screen refreshes, and everything works as intended.

    SO... There must be something I'm not configuring properly in the main window or its connection to the view. I tried ensuring that the MainWindow had updates enabled by calling setUpdatesEnabled( true );, and I tried connecting the scene's changed() signal to the MainWindow's update() slot. Neither seem to help.

    Anybody got any other ideas?

  10. #10
    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: Can't seem to get QGraphicsView to refresh

    Could we see any code related to the problem? How do you insert items to the scene? How do you initialize the view and the scene?

  11. #11
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Sure. It's all open-source, so I'll post anything you'd like. I just didn't want to get flamed for making any horrendously long posts...

    The main window inherits from the GUI done in QT Designer:
    Qt Code:
    1. class Xorbz : public QMainWindow, private Ui::XorbzGui
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. Xorbz( QWidget* parent = 0, Qt::WFlags fl = Qt::Window );
    7. ~Xorbz();
    8.  
    9. bool event( QEvent* e );
    10.  
    11. public slots:
    12. virtual void gameNew(); ///< Create a new game (solo or network)
    13. virtual void gameJoin(); ///< Join a network game
    14. virtual void gameExit(); ///< Quit playing XorbZ
    15. virtual void helpIndex(); ///< Open the help index
    16. virtual void helpContents(); ///< Open the help contents
    17. virtual void helpAbout(); ///< Display a dialog with XorbZ info
    18. virtual void helpAboutQt(); ///< Display information about Qt
    19. virtual void toolsExportLevel(); ///< Save a XorbZ level to text format
    20. virtual void toolsImportTextLevel(); ///< Generate a XorbZ level from a text file
    21.  
    22. void playSound( SoundType s ) { if( sounds[s]) sounds[s]->play(); };
    23.  
    24. protected:
    25. class Xorbz_Game* currentGame; ///< The current XorbZ game
    26. void sendToServer( QString message );
    27.  
    28. private:
    29. void updateScores();
    30. void initGui(); ///< Initialize the GUI
    31. Xorbz_Sound* sounds[ NumSounds ]; ///< An array of sounds for various events
    32. Xorbz_GameInfo* myGameInfo; ///< A pointer to the game information struct
    33. Xorbz_Board* myBoard; ///< The graphics scene
    34. Xorbz_Level* myLevel; ///< A pointer to the XorbZ level being played
    35. QGraphicsView* viewFrame;
    36.  
    37. QTcpSocket* tcpSocket; ///< The connection to the game server
    38. void networkConnect( QHostAddress server );
    39.  
    40. void showStatus( QString msg, int t=0 ) { QMainWindow::statusBar()->showMessage( msg, t ); };
    41.  
    42. private slots:
    43. void networkRead();
    44. void networkError( QAbstractSocket::SocketError e );
    45.  
    46. };
    To copy to clipboard, switch view to plain text mode 

    The main window initializes like so. Note that viewFrame is the name of the QGraphicsView:
    Qt Code:
    1. Xorbz::Xorbz( QWidget* parent, Qt::WFlags fl)
    2. : QMainWindow( parent, fl)
    3. {
    4. // Create a splash screen
    5. QSplashScreen* s = new QSplashScreen( QPixmap::QPixmap( SplashScreenPixmap ) );
    6. s->show();
    7. s->showMessage( "Xorbz is loading...", Qt::AlignLeft | Qt::AlignBottom, QCOLOR_WHITE );
    8. currentGame = NULL;
    9. myGameInfo = NULL;
    10.  
    11. // Initialize the GUI
    12. initGui();
    13. setUpdatesEnabled( true );
    14.  
    15. // Load the graphics
    16. qDebug( "Loading graphics..." );
    17. s->showMessage("Loading graphics...", Qt::AlignLeft | Qt::AlignBottom, QCOLOR_WHITE );
    18. myBoard = new Xorbz_Board( /*this*/ );
    19. viewFrame->setScene( (QGraphicsScene*)myBoard );
    20.  
    21. // Initialize the sound system
    22. ...
    23.  
    24. // Other initialization
    25. s->showMessage("Finishing up initialization...", Qt::AlignLeft | Qt::AlignBottom, QCOLOR_WHITE );
    26. // Seed random numbers
    27. srand( QTime::QTime().secsTo(QTime::currentTime()) );
    28. tcpSocket = new QTcpSocket(this);
    29. myLevel = new Xorbz_Level();
    30.  
    31. // Close the splash screen
    32. s->finish( this );
    33. delete s;
    34. }
    To copy to clipboard, switch view to plain text mode 

    The initGui() function referenced is here:
    Qt Code:
    1. void Xorbz::initGui( void )
    2. {
    3. // First start the UI from the designer
    4. setupUi( this );
    5.  
    6. // Now add all the components not present
    7. setWindowTitle( "XorbZ" );
    8.  
    9. // Connect actions to slots
    10. ...
    11.  
    12. }
    To copy to clipboard, switch view to plain text mode 

    The scene is subclassed into Xorbz_Board:
    Qt Code:
    1. class Xorbz_Board : public QGraphicsScene
    2. {
    3. public:
    4. Xorbz_Board( QObject* parent = NULL );
    5. ~Xorbz_Board( void );
    6.  
    7. void setLevel( Xorbz_Level* newLevel = NULL );
    8. void setInfo( Xorbz_GameInfo* gameInfo );
    9. Xorbz_Marker* addMarker( Xorbz_Node* node );
    10. Xorbz_Marker* moveMarker( Xorbz_Node* from, Xorbz_Node* to );
    11.  
    12. private:
    13. QTimer* timer; ///< The animation timer
    14. Xorbz_Graphics* graphics; ///< The graphics used to draw the board
    15. Xorbz_Level* level; ///< A pointer to the current level
    16. QList<Xorbz_Marker*> markers; ///< Markers on the board
    17. QList<Xorbz_PlayerDisplay*> players; ///< Player info displays
    18.  
    19. };
    To copy to clipboard, switch view to plain text mode 

    And the board gets initialized like so:
    Qt Code:
    1. Xorbz_Board::Xorbz_Board( QObject* parent )
    2. : QGraphicsScene( 0, 0, 640, 480, parent )
    3. {
    4. // Create the graphics
    5. graphics = new Xorbz_Graphics();
    6.  
    7. // Set the default background
    8. setBackgroundBrush( QCOLOR_BACKGROUND );
    9.  
    10. // Setup an animation timer
    11. timer = new QTimer( this );
    12. connect(timer, SIGNAL(timeout()), this, SLOT(advance()));
    13. timer->start( SceneUpdatePeriod );
    14.  
    15. }
    To copy to clipboard, switch view to plain text mode 

    Most of the scene items are added by the setLevel function:
    Qt Code:
    1. void Xorbz_Board::setLevel( Xorbz_Level* newLevel )
    2. {
    3. // Clear the scene of all components
    4. qDeleteAll( items() );
    5.  
    6. // Store a pointer to the new level
    7. level = newLevel;
    8.  
    9. // Now reconstruct the board with new level items
    10. if( level )
    11. {
    12. quint8 scale = level->scale;
    13. quint8 width = level->width;
    14. Xorbz_GNode* gn;
    15. int i, x, y;
    16.  
    17. // Set the graphics, including background
    18. setBackgroundBrush( *level->background );
    19. graphics->scale( scale );
    20.  
    21. // Create GNodes and Markers
    22. for(i=0; i<(int)(width*level->height); i++)
    23. {
    24. Xorbz_Node* n = level->node(i);
    25.  
    26. if( n->type() != Xorbz_Node::NodeTypeNone )
    27. {
    28. // Calculate the location for this node
    29. y = level->gridOriginY + scale*(i / width) - scale/2;
    30. x = level->gridOriginX + scale*(i % width) - ( i/width & 1 ? 0 : scale/2 );
    31.  
    32. // Create the GNode
    33. gn = new Xorbz_GNode( n, graphics );
    34. gn->setPos( x, y );
    35. gn->setAcceptedMouseButtons(0);
    36. addItem( gn );
    37.  
    38. // If the node is occupied...
    39. if( n->type() >= Xorbz_Node::NodeTypePlayer1 )
    40. {
    41. // ...Create a marker
    42. addMarker( n );
    43. }
    44. }
    45. }
    46.  
    47. // Create a title
    48. QGraphicsTextItem* title = addText( level->title, QFONT_LEVEL_TITLE );
    49. title->setPos( LevelTitleX, LevelTitleY );
    50. title->setZValue( LevelTitleZ );
    51. title->setDefaultTextColor( QCOLOR_LEVEL_TITLE );
    52. title->setVisible( true );
    53.  
    54. }
    55.  
    56. // Update the scene
    57. update();
    58. }
    To copy to clipboard, switch view to plain text mode 

    I think the core of the problem is in there someplace. I can provide the code for the other classes as well (eg Xorbz_GNode, et al) if you think the issue may be there.

    Thanks!

  12. #12
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Here's the GUI for QT Designer...
    Attached Files Attached Files

  13. #13
    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: Can't seem to get QGraphicsView to refresh

    Quote Originally Posted by smahnken View Post
    Sure. It's all open-source, so I'll post anything you'd like. I just didn't want to get flamed for making any horrendously long posts...
    Well... you could have limited yourself to the relevant part of the code...

    Where do you accept hover events?

  14. #14
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    The Xorbz_GNode constructor:

    Qt Code:
    1. Xorbz_GNode::Xorbz_GNode( Xorbz_Node* node, Xorbz_Graphics* graphics )
    2. :QGraphicsPixmapItem( graphics->marker( Xorbz_Node::NodeTypeEmpty ) ),
    3. myNode( node ),
    4. myGraphics( graphics )
    5. {
    6. currentWarpFrame = 0;
    7. highlight = QColor::QColor("Transparent");
    8. setZValue( LayerBackground );
    9. setAcceptHoverEvents( true );
    10. setVisible( true );
    11. }
    To copy to clipboard, switch view to plain text mode 

    The class declaration is pretty simple:
    Qt Code:
    1. class Xorbz_GNode : public QObject, public QGraphicsPixmapItem
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. Xorbz_GNode( Xorbz_Node* node, Xorbz_Graphics* graphics );
    7.  
    8. inline int type() const { return Xorbz_Graphics::TypeXorbzMarker; };
    9. inline Xorbz_Node* node() const { return myNode; };
    10.  
    11. // Override members
    12. void advance ( int phase );
    13. void hoverEnterEvent( QGraphicsSceneHoverEvent* event );
    14. void hoverLeaveEvent( QGraphicsSceneHoverEvent* event );
    15. void paint ( QPainter * p, const QStyleOptionGraphicsItem* opt, QWidget * w = 0 );
    16.  
    17. private:
    18. QColor highlight;
    19. Xorbz_Node* myNode;
    20. Xorbz_Graphics* myGraphics;
    21. int currentWarpFrame;
    22. };
    To copy to clipboard, switch view to plain text mode 

    I did incorporate pherthyl's idea of just drawing the highlight in the overridden paint() function, so the hover event handler just sets the flag (a color, actually) and calls update():
    Qt Code:
    1. void Xorbz_GNode::hoverEnterEvent( QGraphicsSceneHoverEvent* event )
    2. {
    3. // Highlight our current node
    4. highlight = QCOLOR_GREEN;
    5.  
    6. update();
    7. }
    To copy to clipboard, switch view to plain text mode 

    The hoverLeave event just sets the color back to "Transparent" and calls update().

  15. #15
    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: Can't seem to get QGraphicsView to refresh

    And you don't see any changes when you hover over some item, right? Does the hover event handler get called at all? Could you verify that? Why do you make your item inherit QObject, by the way?

  16. #16
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    And you don't see any changes when you hover over some item, right?
    Correct.

    Does the hover event handler get called at all? Could you verify that?
    Yes, it does. I've confirmed it putting a breakpoint on the hoverEnter event handler; it gets hit as soon as I mouse over the item.

    Why do you make your item inherit QObject, by the way?
    Umm... Probably legacy code I haven't cleaned up yet.

  17. #17
    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: Can't seem to get QGraphicsView to refresh

    What is the implementation of paint() and boundingRect() of your item?

  18. #18
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't seem to get QGraphicsView to refresh

    Qt Code:
    1. void Xorbz_GNode::paint ( QPainter * p, const QStyleOptionGraphicsItem* opt, QWidget * w )
    2. {
    3. int s = (int)boundingRect().width();
    4.  
    5. // First paint the pixmap
    6. QGraphicsPixmapItem::paint( p, opt, w );
    7.  
    8. // Highlight appropriately
    9. p->setPen( highlight );
    10. p->drawEllipse( -1, -1, s, s );
    11.  
    12. // If the node is part of a warp group, draw the warp graphics
    13. if( myNode->warps() )
    14. {
    15. p->drawPixmap( 0, 0, myGraphics->warp()[ currentWarpFrame ] );
    16. }
    17. }
    To copy to clipboard, switch view to plain text mode 

    There is no implementation of boundingRect(). The QGraphicsPixmapItem version should do the job... Do I need to override it?

  19. #19
    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: Can't seem to get QGraphicsView to refresh

    Try surrounding the call to the base class implementation with QPainter::save() and QPainter::restore() and see if it helps. On the other hand you might be drawing the ellipse incorrectly. Try changing the code to
    Qt Code:
    1. p->drawRect(boundingRect());
    To copy to clipboard, switch view to plain text mode 
    and see if it helps.

Similar Threads

  1. Replies: 2
    Last Post: 26th February 2009, 10:12
  2. Problem determining size of QGraphicsView
    By Bocki in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2008, 14:54
  3. Replies: 3
    Last Post: 12th February 2008, 21:17
  4. getting QGraphicsView to resize
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 22nd January 2008, 03:49
  5. QGraphicsView
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th July 2007, 08:00

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.