pm-ur / propertyeditor

Automatically exported from code.google.com/p/propertyeditor
GNU Lesser General Public License v3.0
0 stars 0 forks source link

proposed patches: optionally limit to only local properties, and support tooltips #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
First of all: I love your property editor. I think it is easy to use and
integrate into an other project. Nice work!

For my purposes, I need to limit the list of properties that are shown to
the user. One way of doing that, is to limit the list of shown properties
to only those that are defined in the object itself, and not in the base
classes. I have implemented this in the proposed patch.

For added flexibility, I will add another method to do this, but more on
that later.

To inform the user on what is what, I have added a tooltip functionality to
the property editor. Note that it completely optional. If you want to
provide tooltips for an object, it is enough to implement a single slot in
that object with the following signature: QVariantHash
__propertyTooltips(). You return a hash with the property name and the
tooltip you want to display.
The property editor model will try to access that slot through the
QMetaObject system. If it does not exist, nothing happens. If it does,
properties that are in that hash get the indicated tooltip shown. Of
course, I have added a tooltip for the property that controls the showing
of inherited properties in PropertyEditor ;-)
Again: this is implemented in the proposed patch. 

I would like to use a similar method to limit the items that are shown for
an object in the editor. By implementing a slot returning a QStringList,
the list of shown properties would be limited to this list. 

The modified files are attached.

Original issue reported on code.google.com by atsom...@gmail.com on 23 Jul 2009 at 9:31

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for your kind words and for the patch.
I like the idea,  I'll take a look this week to your patch and I'll wait to 
finish
it to commit it. I think it will be nice to have a QStringList of NOT to shown
properties too.
Until the end of this year I'll try to add multiple objects edit.

If you want I can add you to the project committers to have write access to 
svn. 

Original comment by taipanro...@gmail.com on 3 Aug 2009 at 7:13

GoogleCodeExporter commented 9 years ago
Did you happen to take a look at it yet? 

I think adding a stringlist to hide properties would work too, but it is 
important 
to have a clear definition of the order in which the various limitation methods 
are 
applied. If a property is in both the show and the dont't show lists, will it 
be 
shown or not? 

For now, I think I do not need commit rights yet. Thanks for the vote of 
confidence 
though :-)

Original comment by atsom...@gmail.com on 10 Aug 2009 at 4:42