Warning, /frameworks/syntax-highlighting/autotests/folding/highlight.qml.fold is written in an unsupported language. File is not indexed.

0001 import Qt 4.6
0002 pragma Singleton
0003 
0004 // some random qml snippets stolen from the qt docs
0005 
0006 Rectangle <beginfold id='1'>{</beginfold id='1'>
0007     important: true
0008     propertyAsdf:
0009     id: container
0010     signalA: bla
0011     property string label
0012     signal clicked
0013     radius: 5; border.color: "black"
0014     color: mouse.pressed ? "steelblue" : "lightsteelblue"
0015     gradient: Gradient <beginfold id='1'>{</beginfold id='1'>
0016             GradientStop <beginfold id='1'>{</beginfold id='1'> position: mouse.pressed ? 1.0 : 0.0; color: "steelblue" <endfold id='1'>}</endfold id='1'>
0017             GradientStop <beginfold id='1'>{</beginfold id='1'> position: mouse.pressed ? 0.0 : 1.0; color: "lightsteelblue" <endfold id='1'>}</endfold id='1'>
0018     <endfold id='1'>}</endfold id='1'>
0019     MouseRegion <beginfold id='1'>{</beginfold id='1'> id: mouse; anchors.fill: parent; onClicked: container.clicked() <endfold id='1'>}</endfold id='1'>
0020     Text <beginfold id='1'>{</beginfold id='1'> anchors.fill: parent; text: container.label; anchors.centerIn: parent <endfold id='1'>}</endfold id='1'>
0021 <endfold id='1'>}</endfold id='1'>
0022 
0023 Rectangle <beginfold id='1'>{</beginfold id='1'>
0024     Script <beginfold id='1'>{</beginfold id='1'>
0025         function calculateMyHeight() <beginfold id='1'>{</beginfold id='1'>
0026             return Math.max(otherItem.height, thirdItem.height);
0027         <endfold id='1'>}</endfold id='1'>
0028     <endfold id='1'>}</endfold id='1'>
0029 
0030     anchors.centerIn: parent
0031     width: Math.min(otherItem.width, 10)
0032     height: calculateMyHeight()
0033     color: <beginfold id='1'>{</beginfold id='1'> if (width > 10) "blue"; else "red" <endfold id='1'>}</endfold id='1'>
0034 <endfold id='1'>}</endfold id='1'>
0035 
0036 Rectangle <beginfold id='1'>{</beginfold id='1'>
0037     default property color innerColor: "black"
0038     property color innerColor: "black"
0039     property alias text: textElement.text
0040     property alias aliasXYZ: testElement.text
0041     signal bar
0042     signal bar(var blah, string yxcv)
0043     width: 240; height: 320;
0044     width: 100; height: 30; source: "images/toolbutton.sci"
0045     ListView <beginfold id='1'>{</beginfold id='1'>
0046         anchors.fill: parent
0047         model: contactModel
0048         delegate: Component <beginfold id='1'>{</beginfold id='1'>
0049             Text <beginfold id='1'>{</beginfold id='1'>
0050                 text: modelData.firstName + " " + modelData.lastName
0051             <endfold id='1'>}</endfold id='1'>
0052         <endfold id='1'>}</endfold id='1'>
0053     <endfold id='1'>}</endfold id='1'>
0054 <endfold id='1'>}</endfold id='1'>
0055 
0056 Item <beginfold id='1'>{</beginfold id='1'>
0057     function say(text) <beginfold id='1'>{</beginfold id='1'>
0058         console.log("You said " + text);
0059     <endfold id='1'>}</endfold id='1'>
0060 <endfold id='1'>}</endfold id='1'>
0061 
0062 <beginfold id='2'>/*</beginfold id='2'>
0063  * multi line comment
0064  <endfold id='2'>*/</endfold id='2'>
0065 
0066 // single line comment
0067 
0068 import QtQuick 2.0
0069 
0070 Rectangle <beginfold id='1'>{</beginfold id='1'>
0071     property real myNumProp: 0.1e12;
0072     property alias sub.color;
0073     signal mySignal(int arg1, string arg2)
0074     color: "lightsteelblue"
0075     width: 320
0076     height: width/2
0077 
0078     Rectangle <beginfold id='1'>{</beginfold id='1'>
0079         id: sub
0080         width: 0x10
0081         height: 007
0082         objectName: 'single quote'
0083         objectName2: a ? b : c;
0084     <endfold id='1'>}</endfold id='1'>
0085 
0086     Rectangle <beginfold id='1'>{</beginfold id='1'>
0087         // comment
0088         id: sub <beginfold id='2'>/*</beginfold id='2'> comment <endfold id='2'>*/</endfold id='2'>
0089         <beginfold id='2'>/*</beginfold id='2'> comment <endfold id='2'>*/</endfold id='2'>width: 0x10
0090         height <beginfold id='2'>/*</beginfold id='2'> comment <endfold id='2'>*/</endfold id='2'>: 007
0091         objectName: <beginfold id='2'>/*</beginfold id='2'> comment <endfold id='2'>*/</endfold id='2'> 'single quote'
0092         objectName2: a ? b : c  <beginfold id='2'>/*</beginfold id='2'> comment <endfold id='2'>*/</endfold id='2'>;
0093     <endfold id='1'>}</endfold id='1'>
0094 <endfold id='1'>}</endfold id='1'>