Results 1 to 1 of 1

Thread: [SOLVED] Widgets Not Expanding; Confused About QSizePolicy

  1. #1
    Join Date
    Oct 2011
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Thumbs up [SOLVED] Widgets Not Expanding; Confused About QSizePolicy

    Within my main window, I have a QVBoxLayout which holds a QTabWidget (appTabs) and a QPushButton (quit). When I expand the application window, quit expands, but appTabs remains the same size. appTabs has a single page that is made up of several widgets and layouts; none of them expand. There's an image attached.app.jpg

    I've tried changing this behavior, but I don't understand how to use QSizePolicy. Within my QMainWindow subclass, I've tried

    Qt Code:
    1. appTabsPolicy = new QSizePolicy(QSizePolicy::Expanding);
    To copy to clipboard, switch view to plain text mode 
    ,

    but I get the error, "QSizePolicy::QSizePolicy(int)’ is private." I haven't even made it to the point where I'm actually applying the policy. What is the proper syntax? Why would a QTabWidget not automatically expand like the push button?


    Added after 1 22 minutes:


    Problem solved. The widgets on my QTabWidget were connected by a QSplitter, and the QSplitter needed to be inside a QLayout.
    Last edited by starkid; 17th October 2011 at 23:14. Reason: thread solved

Similar Threads

  1. Confused about UI
    By Splatify in forum Newbie
    Replies: 1
    Last Post: 27th March 2011, 20:47
  2. confused about licenses ...
    By jimmybaeten in forum Installation and Deployment
    Replies: 10
    Last Post: 26th July 2009, 11:56
  3. Layouts - very confused
    By lhartzman in forum Newbie
    Replies: 3
    Last Post: 19th July 2009, 22:40
  4. Expanding widgets and windows automatically?
    By jakykong in forum Qt Tools
    Replies: 2
    Last Post: 25th September 2008, 02:17
  5. auto expanding widgets
    By bpetty in forum Qt Programming
    Replies: 1
    Last Post: 6th January 2007, 09:57

Tags for this Thread

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.