Results 1 to 3 of 3

Thread: Layout which I can put in front of another

  1. #1
    Join Date
    Feb 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Layout which I can put in front of another

    Hi.

    This is a picture what I would like to achieve.
    application.png

    Left Widget contains some basic widgets (QPushButtons, QLineEdit etc.) and will be able to show and hide using some keyboard shortcut. But most important is to Left Widget did not decrease width of Center Widget but it was something like put in front of it when showed.

    Bottom Widget contains just few basic widgets, and also must be able to show/hide, but don't need to put in front of Central Widget.

    Center Widget fills rest of the free space of QMainWindow and it always be visible.

    I tried to use BorderLayout, and it partially works, but I have two obstacles:
    - I can't hide Left Widget (BorderLayout widgets don't have hide() option so I would have to hide every containing widget one by one)
    - I can't do something as I mentioned to put Left Widget on front of Central Widget without decreasing its width

    Can you suggest me some layouts or ideas so I can do this the most easily?

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

    Default Re: Layout which I can put in front of another

    What you want is a widget that is not part of the layout.

    Needs manual adjustment of height when its parent changes height, but that can easily be done using an event filter.

    Cheers,
    _

  3. #3
    Join Date
    Oct 2013
    Posts
    142
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android
    Thanks
    36
    Thanked 3 Times in 3 Posts

    Default Re: Layout which I can put in front of another

    Quote Originally Posted by anda_skoa View Post
    What you want is a widget that is not part of the layout.

    Needs manual adjustment of height when its parent changes height, but that can easily be done using an event filter.

    Cheers,
    _
    + what anda_skoa said with adding: create a frameless widget(using window flags to remove your window frame) and add/show it whenever you need.
    For the bottom and central widgets, why not add them in a QGridLayout?

    I can't hide Left Widget (BorderLayout widgets don't have hide() option so I would have to hide every containing widget one by one)
    If I am understanding this correctly you are saying that you add the widgets from inside left and bottom directly into the borderlayout, and not creating left/bottom widget and after that add other widgets to them?

Similar Threads

  1. Sudoku front end
    By tom989 in forum Newbie
    Replies: 1
    Last Post: 20th August 2013, 22:49
  2. [Qt4.8] QDeclarativeView in front of QGLWidget
    By flamaros in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2013, 17:12
  3. Move QML into front of frame
    By seanasl in forum Qt Quick
    Replies: 0
    Last Post: 15th December 2011, 15:07
  4. Using pthreads for a front end
    By kachofool in forum Newbie
    Replies: 1
    Last Post: 5th October 2009, 22:13
  5. Bring window to the front
    By Barry79 in forum Newbie
    Replies: 2
    Last Post: 14th August 2009, 17:50

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
  •  
Qt is a trademark of The Qt Company.