我正在尝试找到一种方法来降低停靠小部件,以便只显示标题栏。现在我只是想将小部件隐藏在停靠小部件中,但我得到了这个:
停靠小部件“降低”但宽度不会延伸到整个屏幕,有没有办法解决这个问题?或者其他降低停靠小部件的方法?
这是窗口的代码:
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(320, 240)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
MainWindow.setCentralWidget(self.centralwidget)
self.dockWidget = QtGui.QDockWidget(MainWindow)
self.dockWidget.setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures)
self.dockWidget.setObjectName(_fromUtf8("dockWidget"))
self.dockWidget.setAllowedAreas(Qt.BottomDockWidgetArea)
self.textEdit = QtGui.QTextEdit()
self.textEdit.setGeometry(QtCore.QRect(40, 10, 104, 71))
self.textEdit.setObjectName(_fromUtf8("textEdit"))
self.textEdit.setReadOnly(True)
self.dockWidget.setWidget(self.textEdit)
self.textEdit.setVisible(False)
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8), self.dockWidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))