Custom dock area using Qt 4.4

一笑奈何 提交于 2019-12-19 08:31:47

问题


Is it possible to create custom dock areas using Qt 4.4. I know this is possible in Qt 3 as this document suggests. Excerpt from document"...If you need to create your own dock areas we suggest that you create a subclass of QWidget and add your Q3DockAreas to your subclass...". However, it seems to me that in Qt 4 Q3DockArea has been removed and now the QMainWindow itself has the dock areas. I basically want to have my own dock area widget that I can dock widgets into. This dock area widget can be anywhere in the application. Any ideas on how I can do this?


回答1:


At first, Q3DockArea hasn't been removed in Qt4, actually it has been added. The class which got removed was QDockArea. You can still use this Q3* classes if you have old code, thats what they are made for.

But I would not recommend to use the compatibility classes. How about using a QMainWindow like a QWidget. Create it with a parent Widget, but without menu, toolbar, statusbar and revoke its top-level status with setWindowFlags() and the like.

You can use it as an old style QDockArea, place it where you like and add your QDockWidgets.

Besides, the current Qt Version is 4.5.2, no need to use outdated Versions ;-)



来源:https://stackoverflow.com/questions/1273639/custom-dock-area-using-qt-4-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!