How do I add QDockWidget
to QFrame
? since QFrame does not have addDockWidget
!!!
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys
app = QApplication( sys.argv )
qmainwin = QFrame()
#qmainwin.setWindowFlags(Qt.FramelessWindowHint)
s = QWidget()
vboxlayout = QVBoxLayout( )
spin1 = QSpinBox()
vboxlayout.addWidget( spin1 )
spin2 = QSpinBox()
vboxlayout.addWidget( spin2 )
s.setLayout( vboxlayout )
qdock = QDockWidget( )
qdock.setWindowFlags(Qt.FramelessWindowHint)
qdock.setWidget( s )
qmainwin.addDockWidget( Qt.TopDockWidgetArea, qdock )
qmainwin.show()
app.exec_()
How about this? I added the
QDockWidget
to anQLayout
and then set the layout of theQFrame
.