开发者

How to add a QDockWidget to QGraphicsScene?

开发者 https://www.devze.com 2023-01-23 12:03 出处:网络
Is it possible to add a DockWidget to my QGraphicsScene 开发者_开发百科scene .? If yes how to do it.The best way I see to achieve this would be to create a QMainWindow, set your graphicsScene as the c

Is it possible to add a DockWidget to my QGraphicsScene 开发者_开发百科scene .? If yes how to do it.


The best way I see to achieve this would be to create a QMainWindow, set your graphicsScene as the central widget with

QMainWindow::setCentralWidget(QWidget* widget);

After that, simply add your QDockWidget in the QMainWindow with

QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget* dockwidget);

This option also allows you to add toolbar(s) or menu(s) easily.

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消