Results 1 to 2 of 2

Thread: Size of Widgets in QTabWidgets

  1. #1
    Join Date
    Apr 2015
    Posts
    1
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Size of Widgets in QTabWidgets

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Size of Widgets in QTabWidgets

    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,
    _

Similar Threads

  1. Replies: 5
    Last Post: 24th August 2011, 10:21
  2. Widgets: Let the user change the size
    By Donner in forum Qt Programming
    Replies: 2
    Last Post: 14th November 2010, 20:13
  3. Embedded widgets size
    By Indalo in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2009, 10:12
  4. Resize the height of QTabWidgets
    By tarod in forum Qt Programming
    Replies: 3
    Last Post: 28th July 2008, 12:48
  5. Forcing two widgets to the same size
    By dsandber in forum Qt Tools
    Replies: 3
    Last Post: 7th October 2007, 10:11

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.