I made a custom QDockWidget subclass to handle some specific I/O tasks, but I am having some trouble placing it into a Qt Designer form (a QMainWindow based form).
Qt versions: 4.5.1 on Gentoo Linux, 4.5.2 on Mac OS X
Promoting the QDockWidget doesn't cause any complaints, but when I run my program, the widgets inside my custom dock widget do not appear. The generated code shows Qt is trying to set the contents of my widget to an empty QWidget (dockWidgetContents). Designer does not seem to let me get rid of this dockWidgetContents QWidget, but I can modify its properties. The attached example is for this scenario.
I tried making a plugin for Designer, but that seems like a lot of work just to place it in a form with Designer. Also, I seem to have failed some form of container widget aspect of creating plugins (domXml stuff that I'm supposed to put in).
Promoting the QWidget (dockWidgetContents) inside a generic QDockWidget on the main form has layout issues. The generated code seems to want to replace the layout that the QWidget version of my custom subclass already has. The runtime error is: QLayout: Attempting to add QLayout "" to CustomSubclass "ObjectName", which already has a layout
Any thoughts on how best to solve this issue? It seems strange that Qt Designer lets you put together custom QDockWidget based forms, but fails at letting QDockWidgets be promoted. I can live with the custom code solution, but it seems like the Designer should have a decent way to handle this.
Bookmarks