Known bugs and solutions » History » Version 1
Кирилл Кулаков, 03/04/2012 08:45 PM
1 | 1 | Кирилл Кулаков | h1. Known bugs and solutions |
---|---|---|---|
2 | |||
3 | h2. Desktop UI elements (QML Desktop components) |
||
4 | |||
5 | h3. ToolBar |
||
6 | |||
7 | The following sample doesn't work correctly: |
||
8 | <pre> |
||
9 | import QtQuick 1.1 |
||
10 | import QtDesktop 0.1 |
||
11 | ApplicationWindow { |
||
12 | ToolBar { |
||
13 | ToolButton {text: qsTr("Add account"); onClicked: {textItem.visible = !textItem.visible}} |
||
14 | } |
||
15 | |||
16 | Rectangle { |
||
17 | anchors.fill: parent |
||
18 | Text { id: textItem; text: "Test"} |
||
19 | } |
||
20 | } |
||
21 | </pre> |
||
22 | |||
23 | Because Rectangle override ToolBar. To fix it use the following |
||
24 | <pre> |
||
25 | import QtQuick 1.1 |
||
26 | import QtDesktop 0.1 |
||
27 | ApplicationWindow { |
||
28 | ToolBar { |
||
29 | id: accountTools |
||
30 | ToolButton {text: qsTr("Add account"); onClicked: {textItem.visible = !textItem.visible}} |
||
31 | } |
||
32 | |||
33 | Rectangle { |
||
34 | anchors.top: accountTools.bottom |
||
35 | anchors.bottom: parent.bottom |
||
36 | anchors.left: parent.left |
||
37 | anchors.right: parent.right |
||
38 | Text { id: textItem; text: "Test"} |
||
39 | } |
||
40 | } |
||
41 | </pre> |