I want the Qt window to appear using the following dock widget layout on the right.
alt text http://img72.imageshack.us/img72/6180/docksonside.png
Qt allows you to specify the addDockWidget argument of the QMainWindow method to indicate the position (top, bottom, left, or right), but apparently two QDockWidgets placed on one side will not be placed.
Here is the code that adds the dock widgets. this uses PyQt4, but it should be the same for Qt with C ++
self.memUseGraph = mem_use_widget(self) self.memUseDock = QDockWidget("Memory Usage") self.memUseDock.setObjectName("Memory Usage") self.memUseDock.setWidget(self.memUseGraph) self.addDockWidget(Qt.DockWidgetArea(Qt.RightDockWidgetArea),self.memUseDock) self.diskUsageGraph = disk_usage_widget(self) self.diskUsageDock = QDockWidget("Disk Usage") self.diskUsageDock.setObjectName("Disk Usage") self.diskUsageDock.setWidget(self.diskUsageGraph) self.addDockWidget(Qt.DockWidgetArea(Qt.RightDockWidgetArea),self.diskUsageDock)
When this code is used to add both of them to the right side, one above the other, and not as a captured screenshot. The way I took this shot was to drag them there with the mouse after starting the program, but I need this to start.
source share