Results 1 to 2 of 2

Thread: DockWidget functionality

  1. #1
    Join Date
    Jul 2011
    Posts
    1
    Qt products
    Qt3
    Platforms
    MacOS X

    Default DockWidget functionality

    Hello. I have a mainwindow, I want 3 dockwidget (dw1 dw2 & dw3)
    I want dw3 to span entire bottom and dw1 & dw2 to split remainder of
    window horizontally, what Dockarea do I set for dw1 & dw2? I dont use
    any of the space for central widget. If dw1 is undocked, dw2 should fill
    all space above dw3, and if dw2 is undocked, dw1 should remain same
    size and uncovered centralwidget space should remain empty of other
    widgets.

    addDockWidget(Qt::BottomDockWidgetArea,dw3);
    addDockWidget(Qt::???, dw1);
    addDockWidget(Qt::???, dw2);;

  2. #2
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: DockWidget functionality

    I guess you've got to greate a top-level QMainWindow and a custom QWidget containing couple of QMainWindows . Once you have it , add your dockWidgets for each : with Qt::LeftDockWidgetArea and Qt::RightDockWidgetArea options for the one , and Qt::BottomDockWidgetArea for the other . Don't forget to place these mainWindows in the layout. Once you have this widget , set it as a central in the top-level QMainWindow.
    Qt Code:
    1. main( ... )
    2. {
    3. ..
    4.  
    5. QMainWindow mainWindow ;// main application window
    6.  
    7. CustomCentralWidget centralWindow ;// window containing all of the dockWidgets
    8.  
    9. mainWindow.setCentralWidget(centralWindow );
    10.  
    11. ...
    12. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Toolbar in dockwidget
    By AD in forum Qt Programming
    Replies: 7
    Last Post: 2nd October 2008, 14:34
  2. Dockwidget and Toolbutton
    By sandeepvl in forum Qt Programming
    Replies: 3
    Last Post: 13th May 2008, 07:23
  3. How to put a DockWidget or Widget over others??
    By dungsivn in forum Qt Programming
    Replies: 6
    Last Post: 25th October 2007, 06:12
  4. spy++ like functionality with Qt / X11
    By bpetty in forum Newbie
    Replies: 3
    Last Post: 24th April 2007, 22:10
  5. DockWidget ?
    By allensr in forum Qt Programming
    Replies: 8
    Last Post: 30th January 2007, 23:58

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.