PDA

View Full Version : Add QDockWidget as tab in QTabWidget



vinca
7th June 2016, 19:46
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.

d_stranz
11th June 2016, 17:05
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.