Dynamically updates a set of common style attributes shared by a group of Zuble widgets. More...
Import Statement: | import controls . |
Inherited By: |
ZStyleTarget copies a named subset of property values from a source object (ZScopedMap) containing a dictionary of style name/value pairs into the appropriately named properties on this object. All of the properties defined on the target must belong to the same style group as described below.
Whenever the style source (zStyleSource) signals a property change, ZStyleTarget will copy new values from the source dictionary into extended object's style properties, overwriting the previous contents if a change for that property has occurred.
Item names in the ZScopedMap have the format: "<group>.<propertyName>" where "<group>" names a collection of style properties that are common to a specific object type, the final "." is the property name separator, and "<propertyName>" is the name of the style property on the extended class that is to receive the value from the ZScopedMap dictionary.
Use this object by extending it, defining style properties on the extended class and listing those property names in the zStyleProps array. Styled objects bind to the style properties and update when the source changes. These bindings remain intact even when the source object is switched out for a different source.
Set the zStyleGroup property of extended object to "<group-name>":
zStyleGroup: "my.style.group"
Set the zStyleProps property of extended object to an array of property names to copy from the group:
zStyleProps: ['textColor','textSize','text','bold']
Define the style properties on extended object:
property color textColor: "#DCDCCC" property var textSize: "#DCDCCC" property string text: "#DCDCCC" property bool bold: true
This example would propagate the following style properties from the source into the extended object:
my.style.group.textColor, my.style.group.textSize, my.style.group.text, my.style.group.bold
property names of the style group that will be updates whenever they change on the source
Zuble documentation copyright © 2019 Bob Dinitto. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Zuble is a derivative work of Qt version 5. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.