Pass options to child properties of composed properties
AbandonedPublic

Authored by piggz on Nov 6 2016, 8:54 PM.

Details

Reviewers
staniek
Summary

Implemented for pointf only

Diff Detail

Repository
R13 KProperty
Branch
options
Lint
No Linters Available
Unit
No Unit Test Coverage
piggz updated this revision to Diff 7946.Nov 6 2016, 8:54 PM
piggz retitled this revision from to Pass options to child properties of composed properties.
piggz updated this object.
piggz edited the test plan for this revision. (Show Details)
piggz added a reviewer: staniek.
Restricted Application added a project: KProperty. · View Herald TranscriptNov 6 2016, 8:54 PM
piggz added a comment.Nov 6 2016, 9:05 PM

Only issue I see is that the string display of the composed property (not the child properties) still displays in points.

staniek requested changes to this revision.Nov 6 2016, 9:20 PM
staniek edited edge metadata.
staniek added inline comments.
src/KProperty.cpp
525

Could work but I am usually not a big fan of copying information.

How about handling inheritance for options:

--- src/KProperty.cpp
+++ src/KProperty.cpp
@@ -93,9 +93,9 @@ public:
     inline QVariant option(const char* name, const QVariant& defaultValue) const
     {
         if (options.contains(name))
             return options[name];
-        return defaultValue;
+        return parent->option(name, defaultValue);
     }

KPointComposedProperty creates properties as children already so would this work just fine?

This revision now requires changes to proceed.Nov 6 2016, 9:20 PM
piggz abandoned this revision.Nov 6 2016, 10:12 PM

Simpler solution found