Results 1 to 2 of 2

Thread: Having the MainWindow made completely out of docks

  1. #1
    Join Date
    May 2016
    Posts
    3
    Qt products
    Platforms
    Windows

    Question Having the MainWindow made completely out of docks

    Hi everyone!

    I've started developing an application using PyQt (though C++ answers are welcomed!) and I want it to be made entirely of docks so the user can move, undock and generally re-position everything to whatever they want.

    I began by not setting a central widget for the MainWindow. This provides the exact functionality I want like so:

    working.PNG

    However, if you remove all the docks from a particular side, say for example we remove the right side docks, the left side dock/s expand to cover the entire MainWindow meaning it's impossible to redock anything back onto the right dock area:

    expanded.jpg


    I've also attempted to set a blank widget with size (0,0) as the central widget, however the user can then separate the docks with the individual splitter handles it creates, leaving unusable space between them like so:

    separated.PNG

    Any help is greatly appreciated!

    Cheers,
    Kaine

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Having the MainWindow made completely out of docks

    You were almost there. Use a blank QWidget as the central widget, set its background color to be what you desire. You may have to derive from QWidget so you can override the resizeEvent, but you basically want it to resize to be the same size as the central area of your main window. If you don't use Qt Designer to set up a default UI for your app, then you can configure the main window to have no status, tool, or menu bars if that's what you want.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Mainwindow tabifyed docks
    By hjjohny in forum Qt Programming
    Replies: 0
    Last Post: 20th September 2012, 10:45
  2. connect mainwindow with self-made widgets
    By pinkiP in forum Qt Programming
    Replies: 11
    Last Post: 10th July 2012, 10:16
  3. Add docks and make them visible
    By devent in forum Newbie
    Replies: 6
    Last Post: 15th January 2012, 02:01
  4. Hiding ToolBars/Docks From Main window
    By ComaWhite in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2010, 04:32
  5. Completely lost!!!
    By Zuks in forum Newbie
    Replies: 4
    Last Post: 2nd December 2009, 09:58

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.