Results 1 to 4 of 4

Thread: Maximizing a widget

  1. #1
    Join Date
    Apr 2007
    Posts
    20
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Maximizing a widget

    Dear Group,

    Is there any way in Qt Designer or the Visual Studio plugin version to maximize a widget within a widget? For example I have a QWidget inside a QSplitter. Inside the QWidget is a QTableView. I'd like the QTableView to occupy the entire area of the QWidget and adjust as the QSplitter changes size.

    Another example. I dropped a QTabWidget onto the central widget in a QMainWindow. I'd like to see it occupy the maximum area of the central widget.

    Is there some simple switch I missed seeing?

    Thanks,
    Max

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Maximizing a widget

    Quote Originally Posted by Max Yaffe View Post
    Is there some simple switch I missed seeing?
    Yes, layouts.
    J-P Nurmi

  3. #3
    Join Date
    Apr 2007
    Posts
    20
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Maximizing a widget

    Quote Originally Posted by jpn View Post
    You might think so but I've been wrestling with Qt Designer trying to use layouts in a Main Window form for the past 2 days. I simply want to put a full size Tab Widget in the centralWidget in a form with a few dockWidgets around it. Designer doesn't let me set the layout before the objects are in place. Then if I do happen to get a layout set in the centralWidget (by what magic I don't know), when I start putting in my dockWidgets, they get lodged in the centralWidget according to the installed layout, instead of going into the main Window as dockable Widgets.

    You may be an expert so the answers may be obvious but I think Trolltech would be well served by observing how a novice like me interacts with Qt Designer.

    Thanks again for your help -- I'm going do set Qt Designer aside and do it with code like a real programmer.

    Max

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Maximizing a widget

    Yeah, in case you already have a layout installed and you want to add a dock widget, you might have to break the layout to be able to change the dock widget as docked. Re-add the layout after that.

    This is how I've got used to do it:
    1. Drag a dock widget on the form
    2. drag a tab widget on the form
    3. make the dock widget docked (see docked property in Property Editor)
    4. open up context menu over the background of the form (while no child widgets are selected) and select a layout
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    Max Yaffe (11th July 2007)

Similar Threads

  1. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 17:52
  2. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 14:27
  3. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  4. maximizing own widget on parent
    By masoroso in forum Newbie
    Replies: 8
    Last Post: 21st April 2006, 17:12
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

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.