[Qt-interest] Generic input widgets for varying types - how to?

Nathan Carter nathancarter5 at gmail.com
Fri Mar 27 21:31:27 CET 2009


>> Take a look at QItemEditorFactory:
>>
>> http://doc.trolltech.com/4.5/qitemeditorfactory.html
>>
> Thanks, this looks like what I need. One concern, though.  
> QItemEditorFactory::registerEditor() takes a QVariant::Type to  
> designate the type of data edited. QVariant::Type is restricted to a  
> few predefined Qt classes. Will I run into a brick wall if I try to  
> define an editor for my own custom class (e.g. Vector<3>, a class  
> for three-dimensional vectors (in the mathematical sense))?

No, you can extend QVariant to handle additional types from your own  
code.

	http://doc.trolltech.com/4.5/qmetatype.html

Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090327/35087e8d/attachment.html 


More information about the Qt-interest-old mailing list