How to set QDockWidget to use only the bottom corner of QMainWindow

What I wanted is similar to the picture below. alt text

Thank.

+3
source share
4 answers

Use QMdiArea as the central widget of your MainWindow. And then you can put your widget in any position, which needs only a subclass of QMdiSubWindow. Believe me, this is a much better choice. I tried to do the same thing as you, and ended up using QMdiArea and QMdiSubWindow. This works great for me.

+1
source

, void setAllowedAreas ( Qt::DockWidgetAreas areas ), ( , ). http://doc.qt.io/qt-5/qt.html#DockWidgetArea-enum. .

Constant    Value
Qt::LeftDockWidgetArea  0x1
Qt::RightDockWidgetArea 0x2
Qt::TopDockWidgetArea   0x4
Qt::BottomDockWidgetArea    0x8
Qt::AllDockWidgetAreas  DockWidgetArea_Mask
Qt::NoDockWidgetArea    0
0

, "QDockWidget" , , , , QDockWidget. QWidget, , - . - setPos ( , , ). , , QWidgets z, . QGraphicsView , , . - .

, , .

0

I am using pyqt5

self.map = QtWidgets.QDockWidget(self)
self.map = setGeometry(self.width() - 300, self.height() - 300, 300, 300) 
0
source

Source: https://habr.com/ru/post/1759376/


All Articles