[Interest] Where are the USER properties of Qt-provided QObjects documented?

André Somers andre at familiesomers.nl
Thu Jun 28 09:41:44 CEST 2012

Op 28-6-2012 9:02, Bo Thorsen schreef:
> Den 28-06-2012 08:55, Andre Somers skrev:
>> Op 28-6-2012 8:21, Andreas Pakulat schreef:
>>> Hi,
>>> Am Donnerstag, 28. Juni 2012 schrieb Bo Thorsen :
>>>      Hi Frank,
>>>      Den 28-06-2012 06:40, K. Frank skrev:
>>>      >  Where in the documentation (not the source code) can I find out
>>>      which
>>>      >  of the properties of a standard Qt QObject class is the designated
>>>      >  USER property?
>>>      You can't find this, and it doesn't matter. You might be able to
>>>      find it
>>>      using the QMetaObject introspection, but I guess this is only for
>>>      designer or something like it. I've never used this property.
>>>      >  [...]
>>>      >  For some context, from the documentation for "The Property System":
>>>      >
>>>      >      The USER attribute indicates whether the property is
>>>      designated as
>>>      >      the user-facing or user-editable property for the class.
>>>      What do you need this for?
>>> I don't know what the op needs this for, but KDE's kconfigxt system
>>> uses the property to connect widgets and their corresponding config
>>> file entry automatically.
>> It is also used for things like QDataWidgetMapper.
> And both of these cases support the assumption that this is a property
> that's used by code and not something you care for otherwise. Which is
> why the property isn't documented for each class.
I don't get that reasoning. Isn't that what we do: write such code? Ok, 
perhaps this particular flag isn't used all that much in user code, but 
I have used it in the past when I wrote a class to (de-) serialize a 
load of QObject-derived objects that had a Q_PROPERTY based interface. 
Worked rather nicely. I don't think these flags are implementation 
details that don't need to be documented. The problem with them not 
being documented is, that we also cannot rely on them being stable even 
if we do find out what the flags are.
> That's why I asked OP what he wanted to use it for, since I think he's
> going in a wrong direction and there is some other way to achieve
> whatever it is he is doing.
I do agree that it would be good to get some more insight into what the 
OP wants to achieve. That's usually the problem in questions in 
tech-channels: people ask for details on a specific route, while they 
are quite vague on the journey they are trying to make. Sure I could 
give you details on how to take the steep parts in the Great 
St.Bernards's Pass, but if you'd just have told me that all you want to 
achieve is get from Switserland to Italy as fast as possible, I'd have 
simply told you to take the tunnel instead :-)


More information about the Interest mailing list