Results 1 to 2 of 2

Thread: QDockWidget Close instead of Collapse

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Texas, USA
    Posts
    44
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default QDockWidget Close instead of Collapse

    I would like it so that when a QDockWidget's "x" is pressed the Dock widget closes instead of collapses.

    I tried attaching a slot to the visibilityChanged and then tested whether it was invisible and deleting it but since the visibility changes briefly when going between docked and floating that's not the best solution.

    Any other thoughts? Can I catch the event when the user presses the "x" in a dock widget?

    Thanks

  2. #2
    Join Date
    Mar 2007
    Posts
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: QDockWidget Close instead of Collapse

    This is what I do :

    QDockWidget *dk=new QDockWidget(mainWindow);
    dk->setAttribute(Qt::WA_DeleteOnClose,true);
    So when you hit the "x" it deletes the dockwidget and
    all children.

    Hope this is what you wanted.
    Murielle

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

    GimpMaster (23rd February 2010)

Similar Threads

  1. How to collapse rows of a QFormLayout?
    By abey in forum Qt Programming
    Replies: 2
    Last Post: 14th December 2009, 07:39
  2. preserve collapse/expand of a QTreeView
    By yazwas in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2009, 09:49
  3. QDockWidget and more
    By Carlsberg in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2009, 09:47
  4. QDockWidget
    By ToddAtWSU in forum Qt Programming
    Replies: 6
    Last Post: 29th November 2007, 13:37
  5. QTextEdit is possible collapse text?
    By angel75 in forum Qt Programming
    Replies: 2
    Last Post: 4th July 2006, 13:09

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.