Home · Overviews · Reference · Classes |
The Object class encapsulates a node within a project. Nodes may have further subnodes (properies) and a list value. Object's cannot be instantiated directly, but should be accessed through the Project.property() or QMake_Object() methods.
Returns the name of the Object. For example, in the following .pro snippet:
games_category.hint = desktop
the assigned object name is "hint".
Returns the absolute name of the Object. The absolute name is the entire path required to access the object from any project file. For example, in the following .pro snippet:
games_category.hint = desktop
the absolute name might be "/src/libraries/qtopia.games_category.files".
Returns the current Object value.
Returns true if the value is empty (either null or a single empty string), otherwise false.
Returns a list of all the Object's properties.
Returns the Object's property. If the property does not exist, it is created unless the project is read-only, in which case a null Object is returned.
Set the Object's current value. value may be a string, or a list of strings. This is equivalent to the "=" .pro operator.
Note that calling object.setValue("") clears the value, it does not create a single item that is an empty string.
Clear the Object's current value. This includes all properties. To clear just the value use setValue("") instead of clear().
Append value to the Object's value. value may be a string, or a list of strings. This is equivalent to the "+=" .pro operator.
Unite value with the Object's value. value may be a string, or a list of strings. Uniting a value means to append if the value does not already contain the entry, otherwise do nothing. This is equivalent to the "*=" .pro operator.
Remove value from the Object's value. value may be a string, or a list of strings. This is equivalent to the "-=" .pro operator.
Return the absolute names of Object's that have a property named propertyName that contains the value. value may not be a list. The current object, and all its children are searched.
The absoulte name of an Object may be passed to QMake_Object() to retrieve the Object instance.
If value is omitted, any objects that have the property propertyName will be returned.
Returns true if the object has a property.
Returns true if the Object value contains value, otherwise false. value may not be a list.
Returns the current Object value. If the value is a list, is is joined into a single string with a single space separator (" ").
Returns the current Object value as a quoted string. The string returned could be used in a .pro file to establish an object with the same name.
The function functionname will be called every time the object changes. Note that you should quote the function name.
project.property("FOO").watch("myfunc");
Note: Overuse of this function could have dire effects on the performance of qbuild.
See also Javascript Binding.
Copyright © 2009 Nokia | Qt Extended - QBuild Maintainer Guide |