I get this error when I try to refer to my custom class from .ui
file. What\'s wrong with what I do?
\"QFormBuilder was unable to create a cust
In theory, to have your custom widget work you should only have to call:
loader.registerCustomWidget(TimelinePane)
before calling loader.load(). You need to add the relevant import statements, in your case:
from timeline_pane import TimelinePane
However, I just tested this with PySide 1.1.2 on Ubuntu 12.04 x86_64, and it caused a segfault. YMMV, so please test.
I ended up implementing this workaround: http://www.mail-archive.com/pyside@qt-project.org/msg00306.html
In short, override the QUiLoader's creteWidget() method, and if the class_name of the widget is not in self.availableWidgets(), instantiate it yourself according to the customWidgets instance variable that you've added.
BTW, you can also make use of the right-click "Promote To" functionality in the Qt Designer instead of editing the ui file directly.