I'm trying to create a docked interface in PyQt5, creating a BoxLayout contining my various widgets, and then applying this layout to the QDockWidget.
My approach so far has been:
self.layout = QtWidgets.QBoxLayout(2)
self.layout.addWidget(self.widget_one)
self.layout.addWidget(self.widget_two)
self.docked = QtWidgets.QDockWidget()
self.docked.setLayout(self.layout)
self.docked.show()
I'm currently getting an error as follows:
QWidget::setLayout: Attempting to set QLayout "" on QDockWidget "",
which already has a layout
However, in my code above I can't see where I have added a layout previously, and can't find anything in the documentation to aid me in fixing this.
Where have I gone wrong in my approach?