[PyQt] Designer Customer Widget

Stephen Funkhouser stephen at ddssoft.com
Wed May 8 21:20:26 BST 2013


I'm working on creating a custom widget inherited from QTreeWidget. The 
purpose of this is I'm using the Designer for another programming 
language which doesn't have any of it's own developer tools.  I'm 
creating custom widgets to mimic each of this programming language's 
widgets.  The language has a tree control that I can mimic using 
QTreeWidget, but I need to add a lot of custom properties to the Tree 
columns.  I'm trying to do this by inheriting from QTreeWidgetItems to 
create custom items that have unique properties.  I'm also overriding 
the default TreeWidget Editor by creating a Menu Entry, and a Menu 
Factory that calls a custom dialog to edit the custom widget.  In this 
custom dialog I'm adding a header using setHeaderItem(); which, displays 
properly in Qt Designer.  The problem though, is that it the text 
property of the columns isn't being saved to the .ui file.  Designer 
does add column tags to the .ui file, but the text is just the column 
numbers and not my text added through the QExtensionFactory call to the 
dialog.

Is it possible to get Qt Designer to save custom properties of the 
inherited QTreeWidgetItems objects?

Stephen


More information about the PyQt mailing list