Hello,
is there a way to move a QDockWidget between two QMainWindows?

In the sample code I have two QLabels wrapped into two QDockwidgets and I want 
to be able to move them from one QMainWindow to the other QMainWindow. But it 
doesen't work. What is missing in the code?

Regards
Magnus 


import sys
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QApplication, QMainWindow, QLabel, QDockWidget

app = QApplication(sys.argv)

mw1 = QMainWindow()
mw2 = QMainWindow()

l1 = QLabel("Label 1")
l2 = QLabel("Label 2")

dw1 = QDockWidget("l1")
dw1.setWidget(l1)
dw2 = QDockWidget("l2")
dw2.setWidget(l2)

mw1.addDockWidget(Qt.LeftDockWidgetArea, dw1)
mw1.addDockWidget(Qt.RightDockWidgetArea, dw2)

mw1.show()
mw2.show()

sys.exit(app.exec_())
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to