Results 1 to 1 of 1

Thread: QDockWidget floating at the beginning

  1. #1
    Join Date
    Mar 2006
    Posts
    142
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDockWidget floating at the beginning

    I want to have a dock floating by default, I mean floating at application launch time, letting the user the possibility to dock it in any area, rather than having it docked at the beginning and offering the possibility to make it floating.
    If I write:
    Qt Code:
    1. dock->setFloating(true);
    2. dock->setWidget(w);
    To copy to clipboard, switch view to plain text mode 
    the widget does not appear.
    If I write:
    Qt Code:
    1. dock->setFloating(true);
    2. dock->setWidget(w);
    3. dock->show();
    To copy to clipboard, switch view to plain text mode 
    it appears but can no longer be grabbed and moved anywhere.
    Any idea?


    Added after 34 minutes:


    Solution: it is necessary to dock the widget first and then to undock it by making it floating:
    Qt Code:
    1. dock->setWidget(w);
    2. this->addDockWidget(Qt::TopDockWidgetArea, dock);
    3. dock->setFloating(true);
    To copy to clipboard, switch view to plain text mode 
    Last edited by Caius Aérobus; 2nd March 2011 at 13:15.

  2. The following user says thank you to Caius Aérobus for this useful post:

    AlekseyK (31st March 2016)

Similar Threads

  1. Floating QDockWidget not re-docked by QMainWindow::restoreState
    By stefanadelbert in forum Qt Programming
    Replies: 14
    Last Post: 20th October 2016, 21:16
  2. Replies: 1
    Last Post: 7th December 2010, 21:46
  3. QMainWindow ignores dynamically created, floating QDockWidget
    By stefanadelbert in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2010, 01:06
  4. QDockWidget : No floating
    By prashant in forum Qt Programming
    Replies: 1
    Last Post: 5th October 2009, 18:42
  5. Beginning network programming
    By Morea in forum Qt Programming
    Replies: 3
    Last Post: 29th May 2007, 19:39

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.