Results 1 to 2 of 2

Thread: Make Dock Widgets overlap main view

  1. #1
    Join Date
    Oct 2010
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Make Dock Widgets overlap main view

    I've been trying to do this for the last few days so forgive the old pictures that show a QToolBox instead (I'm using dock windows now).



    How can I stop that? If I add dock windows/QToolBox to the right, then it doesn't shift the main view to the left but overlaps/overlays it. I want the same thing on the left.

    I tried parenting it to my QMdiArea, then it’s a) transparent b) a fixed size that doesn’t resize.

    Strangely if I add a stylesheet, I at least get a background colour


    Like if I add it to the right, then opening the toolbox will cause the main area to resize by cutting off a section of the right.

    Maybe I want a resize policy for the left hand side? Namely: when resizing from the left, dont cut off from the right but cut off instead from the left? Something like that tongue twister I’ve written

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Make Dock Widgets overlap main view

    Dock widgets will always push the central widget aside. If you want to have them "over" the central widget then you have to implement it yourself - make the widget a child of the main window and use QWidget::setGeometry() to set the geometry of the panel. Also reimplement resizeEvent() for the main window so that when the size of the window changes, the panels are adjusted to it (again by using setGeometry).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    genjix (25th October 2010)

Similar Threads

  1. Can I Programatically Overlap Dock Widgets?
    By bieber in forum Qt Programming
    Replies: 0
    Last Post: 29th June 2010, 19:42
  2. resizeEvent for Dock Widgets
    By umulingu in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2010, 11:30
  3. Dock widget between widgets, not near the border
    By maverick_pol in forum Qt Programming
    Replies: 0
    Last Post: 22nd May 2009, 13:23
  4. Dock widgets PROBLEM
    By L1L0 in forum Qt Programming
    Replies: 8
    Last Post: 7th April 2006, 18:29
  5. How to movable dock widgets?
    By becond in forum Qt Tools
    Replies: 3
    Last Post: 21st February 2006, 19:57

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.