|
@@
-20,12
+20,77
|
|
20
|
|
|
20
|
|
|
21
|
import QtQuick 1.1
|
|
21
|
import QtQuick 1.1
|
|
22
|
|
|
22
|
|
|
|
|
|
23
|
//![1]
|
|
23
|
XmlListModel {
|
|
24
|
XmlListModel {
|
|
24
|
// Hard-coded test data
|
|
25
|
// Hard-coded test data
|
|
25
|
xml: "<results><row><speedTrap>0</speedTrap><driver>Fittipaldi</driver><speed>104.12</speed></row><row><speedTrap>0</speedTrap><driver>Stewart</driver><speed>106.12</speed></row><row><speedTrap>0</speedTrap><driver>Hunt</driver><speed>106.12</speed></row><row><speedTrap>1</speedTrap><driver>Fittipaldi</driver><speed>115.12</speed></row><row><speedTrap>1</speedTrap><driver>Stewart</driver><speed>114.12</speed></row><row><speedTrap>1</speedTrap><driver>Hunt</driver><speed>115.12</speed></row><row><speedTrap>2</speedTrap><driver>Hunt</driver><speed>165.23</speed></row><row><speedTrap>2</speedTrap><driver>Fittipaldi</driver><speed>175.23</speed></row><row><speedTrap>2</speedTrap><driver>Stewart</driver><speed>168.23</speed></row><row><speedTrap>3</speedTrap><driver>Hunt</driver><speed>104.87</speed></row><row><speedTrap>3</speedTrap><driver>Fittipaldi</driver><speed>104.43</speed></row><row><speedTrap>3</speedTrap><driver>Stewart</driver><speed>94.83</speed></row><row><speedTrap>4</speedTrap><driver>Hunt</driver><speed>107.87</speed></row><row><speedTrap>4</speedTrap><driver>Fittipaldi</driver><speed>111.84</speed></row><row><speedTrap>4</speedTrap><driver>Stewart</driver><speed>106.84</speed></row><row><speedTrap>5</speedTrap><driver>Hunt</driver><speed>94.87</speed></row><row><speedTrap>5</speedTrap><driver>Stewart</driver><speed>92.37</speed></row><row><speedTrap>5</speedTrap><driver>Fittipaldi</driver><speed>99.37</speed></row><row><speedTrap>6</speedTrap><driver>Hunt</driver><speed>52.87</speed></row><row><speedTrap>6</speedTrap><driver>Fittipaldi</driver><speed>42.87</speed></row><row><speedTrap>6</speedTrap><driver>Stewart</driver><speed>55.87</speed></row><row><speedTrap>7</speedTrap><driver>Hunt</driver><speed>77.87</speed></row><row><speedTrap>7</speedTrap><driver>Fittipaldi</driver><speed>72.87</speed></row><row><speedTrap>7</speedTrap><driver>Stewart</driver><speed>87.87</speed></row><row><speedTrap>8</speedTrap><driver>Hunt</driver><speed>94.17</speed></row><row><speedTrap>8</speedTrap><driver>Fittipaldi</driver><speed>98.17</speed></row><row><speedTrap>8</speedTrap><driver>Stewart</driver><speed>84.17</speed></row><row><speedTrap>9</speedTrap><driver>Hunt</driver><speed>91.87</speed></row><row><speedTrap>9</speedTrap><driver>Fittipaldi</driver><speed>71.87</speed></row><row><speedTrap>9</speedTrap><driver>Stewart</driver><speed>81.87</speed></row><row><speedTrap>10</speedTrap><driver>Hunt</driver><speed>104.87</speed></row><row><speedTrap>10</speedTrap><driver>Fittipaldi</driver><speed>115.87</speed></row><row><speedTrap>10</speedTrap><driver>Stewart</driver><speed>119.87</speed></row><row><speedTrap>11</speedTrap><driver>Hunt</driver><speed>162.87</speed></row><row><speedTrap>11</speedTrap><driver>Fittipaldi</driver><speed>155.84</speed></row><row><speedTrap>11</speedTrap><driver>Stewart</driver><speed>152.84</speed></row><row><speedTrap>12</speedTrap><driver>Hunt</driver><speed>181.87</speed></row><row><speedTrap>12</speedTrap><driver>Fittipaldi</driver><speed>161.85</speed></row><row><speedTrap>12</speedTrap><driver>Stewart</driver><speed>167.85</speed></row><row><speedTrap>13</speedTrap><driver>Hunt</driver><speed>155.87</speed></row><row><speedTrap>13</speedTrap><driver>Fittipaldi</driver><speed>154.87</speed></row><row><speedTrap>13</speedTrap><driver>Stewart</driver><speed>164.87</speed></row><row><speedTrap>14</speedTrap><driver>Hunt</driver><speed>197.57</speed></row><row><speedTrap>14</speedTrap><driver>Fittipaldi</driver><speed>187.54</speed></row><row><speedTrap>14</speedTrap><driver>Stewart</driver><speed>180.54</speed></row><row><speedTrap>15</speedTrap><driver>Fittipaldi</driver><speed>216.87</speed></row><row><speedTrap>15</speedTrap><driver>Hunt</driver><speed>207.87</speed></row><row><speedTrap>15</speedTrap><driver>Stewart</driver><speed>197.87</speed></row><row><speedTrap>16</speedTrap><driver>Hunt</driver><speed>82.87</speed></row><row><speedTrap>16</speedTrap><driver>Fittipaldi</driver><speed>79.37</speed></row><row><speedTrap>16</speedTrap><driver>Stewart</driver><speed>85.37</speed></row><row><speedTrap>17</speedTrap><driver>Hunt</driver><speed>153.87</speed></row><row><speedTrap>17</speedTrap><driver>Fittipaldi</driver><speed>143.87</speed></row><row><speedTrap>17</speedTrap><driver>Stewart</driver><speed>133.87</speed></row><row><speedTrap>18</speedTrap><driver>Hunt</driver><speed>89.87</speed></row><row><speedTrap>18</speedTrap><driver>Fittipaldi</driver><speed>95.85</speed></row><row><speedTrap>18</speedTrap><driver>Stewart</driver><speed>98.85</speed></row><row><speedTrap>19</speedTrap><driver>Hunt</driver><speed>169.87</speed></row><row><speedTrap>19</speedTrap><driver>Stewart</driver><speed>167.87</speed></row><row><speedTrap>19</speedTrap><driver>Fittipaldi</driver><speed>154.87</speed></row></results>"
|
|
26
|
xml: "<results><row><speedTrap>0</speedTrap><driver>Fittipaldi</driver><speed>104.12</speed></row>"
|
|
|
|
|
27
|
+"<row><speedTrap>0</speedTrap><driver>Stewart</driver><speed>106.12</speed></row>"
|
|
|
|
|
28
|
// ...
|
|
|
|
|
29
|
//![1]
|
|
|
|
|
30
|
+"<row><speedTrap>0</speedTrap><driver>Hunt</driver><speed>106.12</speed></row>"
|
|
|
|
|
31
|
+"<row><speedTrap>1</speedTrap><driver>Fittipaldi</driver><speed>115.12</speed></row>"
|
|
|
|
|
32
|
+"<row><speedTrap>1</speedTrap><driver>Stewart</driver><speed>114.12</speed></row>"
|
|
|
|
|
33
|
+"<row><speedTrap>1</speedTrap><driver>Hunt</driver><speed>115.12</speed></row>"
|
|
|
|
|
34
|
+"<row><speedTrap>2</speedTrap><driver>Hunt</driver><speed>165.23</speed></row>"
|
|
|
|
|
35
|
+"<row><speedTrap>2</speedTrap><driver>Fittipaldi</driver><speed>175.23</speed></row>"
|
|
|
|
|
36
|
+"<row><speedTrap>2</speedTrap><driver>Stewart</driver><speed>168.23</speed></row>"
|
|
|
|
|
37
|
+"<row><speedTrap>3</speedTrap><driver>Hunt</driver><speed>104.87</speed></row>"
|
|
|
|
|
38
|
+"<row><speedTrap>3</speedTrap><driver>Fittipaldi</driver><speed>104.43</speed></row>"
|
|
|
|
|
39
|
+"<row><speedTrap>3</speedTrap><driver>Stewart</driver><speed>94.83</speed></row>"
|
|
|
|
|
40
|
+"<row><speedTrap>4</speedTrap><driver>Hunt</driver><speed>107.87</speed></row>"
|
|
|
|
|
41
|
+"<row><speedTrap>4</speedTrap><driver>Fittipaldi</driver><speed>111.84</speed></row>"
|
|
|
|
|
42
|
+"<row><speedTrap>4</speedTrap><driver>Stewart</driver><speed>106.84</speed></row>"
|
|
|
|
|
43
|
+"<row><speedTrap>5</speedTrap><driver>Hunt</driver><speed>94.87</speed></row>"
|
|
|
|
|
44
|
+"<row><speedTrap>5</speedTrap><driver>Stewart</driver><speed>92.37</speed></row>"
|
|
|
|
|
45
|
+"<row><speedTrap>5</speedTrap><driver>Fittipaldi</driver><speed>99.37</speed></row>"
|
|
|
|
|
46
|
+"<row><speedTrap>6</speedTrap><driver>Hunt</driver><speed>52.87</speed></row>"
|
|
|
|
|
47
|
+"<row><speedTrap>6</speedTrap><driver>Fittipaldi</driver><speed>42.87</speed></row>"
|
|
|
|
|
48
|
+"<row><speedTrap>6</speedTrap><driver>Stewart</driver><speed>55.87</speed></row>"
|
|
|
|
|
49
|
+"<row><speedTrap>7</speedTrap><driver>Hunt</driver><speed>77.87</speed></row>"
|
|
|
|
|
50
|
+"<row><speedTrap>7</speedTrap><driver>Fittipaldi</driver><speed>72.87</speed></row>"
|
|
|
|
|
51
|
+"<row><speedTrap>7</speedTrap><driver>Stewart</driver><speed>87.87</speed></row>"
|
|
|
|
|
52
|
+"<row><speedTrap>8</speedTrap><driver>Hunt</driver><speed>94.17</speed></row>"
|
|
|
|
|
53
|
+"<row><speedTrap>8</speedTrap><driver>Fittipaldi</driver><speed>98.17</speed></row>"
|
|
|
|
|
54
|
+"<row><speedTrap>8</speedTrap><driver>Stewart</driver><speed>84.17</speed></row>"
|
|
|
|
|
55
|
+"<row><speedTrap>9</speedTrap><driver>Hunt</driver><speed>91.87</speed></row>"
|
|
|
|
|
56
|
+"<row><speedTrap>9</speedTrap><driver>Fittipaldi</driver><speed>71.87</speed></row>"
|
|
|
|
|
57
|
+"<row><speedTrap>9</speedTrap><driver>Stewart</driver><speed>81.87</speed></row>"
|
|
|
|
|
58
|
+"<row><speedTrap>10</speedTrap><driver>Hunt</driver><speed>104.87</speed></row>"
|
|
|
|
|
59
|
+"<row><speedTrap>10</speedTrap><driver>Fittipaldi</driver><speed>115.87</speed></row>"
|
|
|
|
|
60
|
+"<row><speedTrap>10</speedTrap><driver>Stewart</driver><speed>119.87</speed></row>"
|
|
|
|
|
61
|
+"<row><speedTrap>11</speedTrap><driver>Hunt</driver><speed>162.87</speed></row>"
|
|
|
|
|
62
|
+"<row><speedTrap>11</speedTrap><driver>Fittipaldi</driver><speed>155.84</speed></row>"
|
|
|
|
|
63
|
+"<row><speedTrap>11</speedTrap><driver>Stewart</driver><speed>152.84</speed></row>"
|
|
|
|
|
64
|
+"<row><speedTrap>12</speedTrap><driver>Hunt</driver><speed>181.87</speed></row>"
|
|
|
|
|
65
|
+"<row><speedTrap>12</speedTrap><driver>Fittipaldi</driver><speed>161.85</speed></row>"
|
|
|
|
|
66
|
+"<row><speedTrap>12</speedTrap><driver>Stewart</driver><speed>167.85</speed></row>"
|
|
|
|
|
67
|
+"<row><speedTrap>13</speedTrap><driver>Hunt</driver><speed>155.87</speed></row>"
|
|
|
|
|
68
|
+"<row><speedTrap>13</speedTrap><driver>Fittipaldi</driver><speed>154.87</speed></row>"
|
|
|
|
|
69
|
+"<row><speedTrap>13</speedTrap><driver>Stewart</driver><speed>164.87</speed></row>"
|
|
|
|
|
70
|
+"<row><speedTrap>14</speedTrap><driver>Hunt</driver><speed>197.57</speed></row>"
|
|
|
|
|
71
|
+"<row><speedTrap>14</speedTrap><driver>Fittipaldi</driver><speed>187.54</speed></row>"
|
|
|
|
|
72
|
+"<row><speedTrap>14</speedTrap><driver>Stewart</driver><speed>180.54</speed></row>"
|
|
|
|
|
73
|
+"<row><speedTrap>15</speedTrap><driver>Fittipaldi</driver><speed>216.87</speed></row>"
|
|
|
|
|
74
|
+"<row><speedTrap>15</speedTrap><driver>Hunt</driver><speed>207.87</speed></row>"
|
|
|
|
|
75
|
+"<row><speedTrap>15</speedTrap><driver>Stewart</driver><speed>197.87</speed></row>"
|
|
|
|
|
76
|
+"<row><speedTrap>16</speedTrap><driver>Hunt</driver><speed>82.87</speed></row>"
|
|
|
|
|
77
|
+"<row><speedTrap>16</speedTrap><driver>Fittipaldi</driver><speed>79.37</speed></row>"
|
|
|
|
|
78
|
+"<row><speedTrap>16</speedTrap><driver>Stewart</driver><speed>85.37</speed></row>"
|
|
|
|
|
79
|
+"<row><speedTrap>17</speedTrap><driver>Hunt</driver><speed>153.87</speed></row>"
|
|
|
|
|
80
|
+"<row><speedTrap>17</speedTrap><driver>Fittipaldi</driver><speed>143.87</speed></row>"
|
|
|
|
|
81
|
+"<row><speedTrap>17</speedTrap><driver>Stewart</driver><speed>133.87</speed></row>"
|
|
|
|
|
82
|
+"<row><speedTrap>18</speedTrap><driver>Hunt</driver><speed>89.87</speed></row>"
|
|
|
|
|
83
|
+"<row><speedTrap>18</speedTrap><driver>Fittipaldi</driver><speed>95.85</speed></row>"
|
|
|
|
|
84
|
+"<row><speedTrap>18</speedTrap><driver>Stewart</driver><speed>98.85</speed></row>"
|
|
|
|
|
85
|
+"<row><speedTrap>19</speedTrap><driver>Hunt</driver><speed>169.87</speed></row>"
|
|
|
|
|
86
|
+"<row><speedTrap>19</speedTrap><driver>Stewart</driver><speed>167.87</speed></row>"
|
|
|
|
|
87
|
+"<row><speedTrap>19</speedTrap><driver>Fittipaldi</driver><speed>154.87</speed></row>"
|
|
|
|
|
88
|
+"</results>"
|
|
|
|
|
89
|
//![2]
|
|
26
|
query: "/results/row"
|
|
90
|
query: "/results/row"
|
|
27
|
|
|
91
|
|
|
28
|
XmlRole { name: "speedTrap"; query: "speedTrap/string()" }
|
|
92
|
XmlRole { name: "speedTrap"; query: "speedTrap/string()" }
|
|
29
|
XmlRole { name: "driver"; query: "driver/string()" }
|
|
93
|
XmlRole { name: "driver"; query: "driver/string()" }
|
|
30
|
XmlRole { name: "speed"; query: "speed/string()" }
|
|
94
|
XmlRole { name: "speed"; query: "speed/string()" }
|
|
31
|
}
|
|
95
|
}
|
|
|
|
|
96
|
//![2]
|