Results 1 to 2 of 2

Thread: how to make the QDockWidget float

  1. #1
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question how to make the QDockWidget float

    please help me!
    I want to make the QDockWidget object to float all the time , but when i use the property Qt::NoDockWidgetArea in the QMainWindow::addDockWidget() the object can also be docked at the four place ,how to forbid it to dock at anywhere?

    code like this:

    m_dock = new QDockWidget(tr("test"), this);
    m_dock->setFloating(true);
    QWdiget*dlg = new QWdiget;
    m_dock->setWidget(dlg);
    this->addDockWidget(Qt::LeftDockWidgetArea, m_dock);

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to make the QDockWidget float

    Why do you need a QDockWidget when you don't want it to be docked? Use a QDialog instead

Similar Threads

  1. Replies: 4
    Last Post: 18th May 2011, 17:59
  2. Replies: 1
    Last Post: 15th December 2010, 13:20
  3. Replies: 1
    Last Post: 7th December 2010, 21:46
  4. Replies: 1
    Last Post: 10th February 2009, 09:42
  5. float
    By mickey in forum General Programming
    Replies: 5
    Last Post: 25th July 2006, 11:52

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.