神马文学网:想知道神马,提问回答学习问题百度都知道

QGraphicsScene size

来源:百度文库 编辑:神马文学网 时间:2024/04/28 18:05:50
 QGraphicsScene size
Hi

I am trying to create a GraphicsView where I can draw using the entire window. To do this I create a GraphicsScene with the view's rect as constructor. The result is that I get scrollbars (although it shouldnt be needed as the scene should be the same size as the view) that are pre-scrolled (why does it scroll by itself?) a few pixels in both directions. What am I doing wrong here?

Qt Code:Switch view To copy to clipboard, switch view to plain text mode 
  •  Re: QGraphicsScene size

    QRect is a little weird.
    The size is actually with 1 pxiel smaller in each direction( 639x479).
    So you have to adjust it a bit.

    Also, I used setFixedxSize since if you resize it, the scroll bars appear again.

    Qt Code:Switch view To copy to clipboard, switch view to plain text mode 
    Regards