Results 1 to 2 of 2

Thread: Add QDockWidget as tab in QTabWidget

  1. #1
    Join Date
    Jun 2016
    Posts
    1

    Default Add QDockWidget as tab in QTabWidget

    Hello,

    I am new in Qt development so I want to ask is it possible to add QDockWidget as tab in QTabWidget. I have read in the Qt documentation that QDockWidget is intended to be used as a child of main window object but I hope there is a way to achieve what I want.
    I have made a lot of research but I can not find a way to do that.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Add QDockWidget as tab in QTabWidget

    I don't know if you have solved this yet, but here's an answer:

    As you have read, you cannot use QDockWidget as a child of QTabWidget. However, if you make the contents of your QDockWidget into a stand-alone class derived from QWidget, then you can add an instance this derived class as the child of QTabWidget as well as using it inside of QDockWidget.

    If what you are asking is, "Can I dock a QDockWidget inside of a QTabWidget by dragging it from the QMainWindow into the QTabWidget?" the answer is no. QTabWidget does not have the built-in support for docked windows that QMainWindow does.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. How to add QDockWidget to QTabWidget
    By Abderrahim in forum Newbie
    Replies: 0
    Last Post: 28th January 2016, 12:32
  2. Replies: 6
    Last Post: 21st August 2013, 12:53
  3. Tabified QDockWidget, QTabWidget, and Style Sheets
    By prof.ebral in forum Qt Programming
    Replies: 1
    Last Post: 7th December 2012, 16:49
  4. Replies: 1
    Last Post: 7th December 2010, 21:46
  5. Qtabwidget in Qdockwidget
    By LordQt in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2007, 12:36

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.