PDA

View Full Version : Size of Widgets in QTabWidgets



krassy_gochev
7th April 2015, 02:45
I'm trying to implement an app, where I have a QTabWidget, which has a QGraphicsView and a related scene to it. However, my main window also has a status bar and a docked widget to the right, so the size of the main window is bigger than the size of the QGraphics View(which is in the tab).
Hence, I'm trying to find the size of the QGraphics view, so that I can draw my graphics items in it correctly. (I'll just need one scene, which I'll adjust to the View's size, since I won't really be drawing anything that complex)

However, when I try to get its size (Or the size of any kind of widget, which is inside one of my tabs), I always get 640 x 480. Even if my main window is resized quite a lot when I call the function.

So how do I get the correct size of any widget, which is inside a tab of a QTabWidget?


P.S. This is my first post, so let me know if I haven't explained it clearly, or if I need to paste the code

anda_skoa
7th April 2015, 08:00
Did you add your widget using QTabWidget::addTab() or did you add it in Qt Designer?
If the latter, did you assign a layout to the tab widget page?

Cheers,
_