1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import QtQuick 1.0 QGraphicsWidget { size: "200x100" focusPolicy: QGraphicsWidget.ClickFocus Item { objectName: "declarativeItem" id: item width: 200 height: 100 MouseArea { anchors.fill: parent onPressed: { if (!item.focus) { item.focus = true; } } } } }