\section2 Registering an Instantiable Object Type
-\bold{Any QObject-derived C++ class can be registered as the definition of a
+\b{Any QObject-derived C++ class can be registered as the definition of a
\l{qtqml-typesystem-objecttypes.html}{QML object type}}. Once a
class is registered with the QML type system, the class can be declared and
instantiated like any other object type from QML code. Once created, a
}
\endqml
-For maximum interopability with QML, \bold {any property that is writable should
+For maximum interopability with QML, \b {any property that is writable should
have an associated NOTIFY signal} that is emitted whenever the property value
has changed. This allows the property to be used with \l{Property
Binding}{property binding}, which is an essential feature of QML that enables
semantics of Qt C++ objects, and will not ever take ownership of a QObject
instance which already has a parent.
-*/
\ No newline at end of file
+*/
Once an object instance is created, the value of its \e id attribute cannot
be changed. While it may look like an ordinary property, the \c id attribute
-is \bold{not} an ordinary \c property attribute, and special semantics apply
+is \b{not} an ordinary \c property attribute, and special semantics apply
to it; for example, it is not possible to access \c myTextInput.id in the above
example.
Text {
//dot notation
font.pixelSize: 12
- font.bold: true
+ font.b: true
}
Text {
//group notation
- font { pixelSize: 12; bold: true }
+ font { pixelSize: 12; b: true }
}
\endcode
\section1 Property Change Behavior for Basic Types
Some basic types have properties: for example, the \l font type has
-\c pixelSize, \c family and \c bold properties. Unlike properties of
+\c pixelSize, \c family and \c b properties. Unlike properties of
\l{qtqml-typesystem-topic.html#qml-object-types}{object types}, properties of
basic types do not provide their own property change signals. It is only possible
to create a property change signal handler for the basic type property itself:
// changing any of the font attributes, or reassigning the property
// to a different font value, will invoke the onFontChanged handler
Keys.onDigit1Pressed: font.pixelSize += 1
- Keys.onDigit2Pressed: font.bold = !font.bold
+ Keys.onDigit2Pressed: font.b = !font.b
Keys.onDigit3Pressed: font = otherText.font
}
\endqml
\section1 Using the url Type
When a relative URL is written to a \c url type property, it is converted
- into a URL object, so \bold {matching the URL value against the input string
+ into a URL object, so \b {matching the URL value against the input string
value will fail}. Instead, convert the string to a URL using Qt.resolvedUrl()
for means of comparison, and use \c toString() to get the contents of the URL:
\table
\header
\li {4, 1}
- \bold GridViews with GridView.LeftToRight flow
+ \b GridViews with GridView.LeftToRight flow
\row
- \li \bold (H) Left to right \bold (V) Top to bottom
+ \li \b (H) Left to right \b (V) Top to bottom
\image gridview-layout-lefttoright-ltr-ttb.png
- \li \bold (H) Right to left \bold (V) Top to bottom
+ \li \b (H) Right to left \b (V) Top to bottom
\image gridview-layout-lefttoright-rtl-ttb.png
- \li \bold (H) Left to right \bold (V) Bottom to top
+ \li \b (H) Left to right \b (V) Bottom to top
\image gridview-layout-lefttoright-ltr-btt.png
- \li \bold (H) Right to left \bold (V) Bottom to top
+ \li \b (H) Right to left \b (V) Bottom to top
\image gridview-layout-lefttoright-rtl-btt.png
\header
\li {4, 1}
- \bold GridViews with GridView.TopToBottom flow
+ \b GridViews with GridView.TopToBottom flow
\row
- \li \bold (H) Left to right \bold (V) Top to bottom
+ \li \b (H) Left to right \b (V) Top to bottom
\image gridview-layout-toptobottom-ltr-ttb.png
- \li \bold (H) Right to left \bold (V) Top to bottom
+ \li \b (H) Right to left \b (V) Top to bottom
\image gridview-layout-toptobottom-rtl-ttb.png
- \li \bold (H) Left to right \bold (V) Bottom to top
+ \li \b (H) Left to right \b (V) Bottom to top
\image gridview-layout-toptobottom-ltr-btt.png
- \li \bold (H) Right to left \bold (V) Bottom to top
+ \li \b (H) Right to left \b (V) Bottom to top
\image gridview-layout-toptobottom-rtl-btt.png
\endtable
\table
\header
\li {2, 1}
- \bold ListViews with Qt.Vertical orientation
+ \b ListViews with Qt.Vertical orientation
\row
\li Top to bottom
\image listview-layout-toptobottom.png
\image listview-layout-bottomtotop.png
\header
\li {2, 1}
- \bold ListViews with Qt.Horizontal orientation
+ \b ListViews with Qt.Horizontal orientation
\row
\li Left to right
\image listview-layout-lefttoright.png