Results 1 to 1 of 1

Thread: QtDockWidget Resize

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Location
    Kingston, Ontario Canada
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QtDockWidget Resize

    Hello.

    ((For the actual question without the background-for-context, scroll down to the line of equal signs))

    I've been hacking away at this problem on and off for two weeks now, searching through Google, trying things, looking through Qt's actual source code to see how QMainWindow and QMainWindowLayout worked, etc. I am currently working on a code editor partially as an incentive to learn C++ and Qt and partially because the language I'm writing it for has crappy editors and apart from Eclipse -- no other project I can start off with and modify to get me any closer than I would be simply starting from scratch.

    Functionally I would like the document editor to fit a few design features:

    "0") Multiplatform with little-to-no difficulty in porting Windows <----> Linux (at the least... Mac too if someone else wants to. I can't, I don't own a Mac.)
    1) Editor windows could be pulled off into floatable windows (for those with multiple monitors).
    2) Editor windows could be arranged side by side evenly, like Qt Creator's side-by-side view mode.
    3) Editor windows could be arranged in a tabbed environment.

    So obviously QtDockWidgets lent themselves ALMOST perfectly as the functional containers for the editors... I was able to create a child QMainWindow of the main QMainWindow (the child actually being the parent's centralWidget) to contain the dockwidgets with a null central widget on the child (to allow dockWidgets docked inside to fill its space) and have everything dock in the child's TopDockWidgetArea so that each dock widget is either tabbed or split with a vertical splitter.

    ======================

    The problem: the vertical splitter between dock widgets is very arbitrary. I would *really* like to have it evenly split the two (maybe three, etc.) dock widgets that are docked in TopDockWidgetArea (initially -- the user can then grab and move to whatever size they want... but I'd want it to be initially that size).

    I know it's possible to move the SeparatorWidget (SplitVCursor?) because obviously the mouse does. Is there any way I can reach in to this and grab it myself and shift it to half (or a third, etc) of the child MainWindow? What I read from prior discussions about related problems suggests that it is NOT possible... counter-intuitively... but no harm in trying.

    I've tried adjusting the size of the DockWidget's contents, re-implementing (I think it was resize()), etc. Didn't even change anything in a weird way... they had absolutely zero effect no matter what I tried.

    I am not against subclassing QMainWindow for the child main window if it allows me more access to the layout.

    Thanks for any help. If possible, assume I know little-to-nothing about Qt in your explanations since I am just learning it.
    -Scott Michaud

    P.S. -- Does anyone know if floating QDockWidgets will get Aero Snap on Windows 7 (and equivalent 'nix implementations) in the future?
    Last edited by Phopojijo; 10th July 2010 at 10:10.

Similar Threads

  1. Replies: 1
    Last Post: 1st May 2010, 23:03
  2. resize a QMainWindow
    By graciano in forum Newbie
    Replies: 4
    Last Post: 19th August 2009, 16:45
  3. Replies: 2
    Last Post: 22nd January 2008, 16:10
  4. QDialog resize ?
    By allensr in forum Qt Programming
    Replies: 5
    Last Post: 11th December 2007, 19:47
  5. QFontDialog - how to resize?
    By anderssonj in forum Qt Programming
    Replies: 2
    Last Post: 19th June 2007, 13:40

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.