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

Helge Preuss helge.preuss at gmx.net
Fri Mar 27 21:40:39 CET 2009


Nathan Carter wrote:
>
>>> 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
Now /that's/ good news.

This will have me plunging much further into Qt's depth than I initially
thought, but well... live and learn, I guess :-)

Thanks, Helge

-- 
Helge Preuss
Freelance Software Developer
+49 30 40 30 10 90
+49 177 2262 484
helge.preuss at gmx.net

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


More information about the Qt-interest-old mailing list