[Interest] Loader keyboard problem
mark diener
rpzrpzrpz at gmail.com
Wed Aug 13 18:40:27 CEST 2014
Oops, I did not finish describing what was the problem with the Loader
Sample.
The Listview on the Loader for screen1.qml does not work with keyboard
navigation, but when loaded as a
component, the Listview keyboard navigation works.
Attached is the sample project:
Built on OSX Mavericks with Qt 5.3.1 QtQuick 2.2
Thanks for any responses.
On Wed, Aug 13, 2014 at 9:37 AM, mark diener <rpzrpzrpz at gmail.com> wrote:
> I am having some strange behavior with a Loader sample program
> for QtQuick 2.2
>
> The Listview on Screen1.qml works
>
> Here is the main.qml file:
>
> import QtQuick 2.2
>
> import QtQuick.Window 2.1
>
>
> Window
>
> {
>
> id: mainwindow
>
>
> visible: true
>
>
> width: Screen.width
>
> height: Screen.height
>
> color: "black"
>
> title: "Test Loader"
>
>
> //Keyboard navigation under OSX Mavericks does not work for the loader
>
> Loader
>
> {
>
> id: genload
>
> anchors.fill: parent
>
> source: "Screen1.qml"
>
> }
>
>
> //Keyboard navigation under OSX Mavericks works for the component
>
> //Comment out the loader and Un-comment the component to see.
>
> //Screen1 {}
>
> }
>
>
> /////////NEW QML FILE BELOW///////////
>
>
> Here is the Screen1.qml file:
>
>
> import QtQuick 2.2
>
>
> Rectangle
>
> {
>
>
> anchors.fill: parent
>
> color: "white"
>
> opacity: 1
>
>
> ListModel
>
> {
>
> id: listdata
>
> ListElement
>
> {
>
> name : "Joe Vabeetz"
>
> cell: "555-1212"
>
> }
>
> ListElement
>
> {
>
> name : "Mary Vabeetz"
>
> cell: "555-1213"
>
> }
>
> ListElement
>
> {
>
> name : "Pete Vabeetz"
>
> cell: "555-1214"
>
> }
>
> }
>
>
>
> Component
>
> {
>
> id: listdelegate
>
> Item
>
> {
>
> id: rowperson
>
> width: parent.width - 10
>
> height: 50
>
>
> MouseArea
>
> {
>
> id: rowmousearea
>
> hoverEnabled: false
>
> anchors.fill: parent
>
> onClicked:
>
> {
>
> listpeople.currentIndex = index
>
> }
>
> }
>
> Text
>
> {
>
> id: rowname
>
> text: '<b>Name:</b> ' + name
>
> }
>
> Text
>
> {
>
> id: rowcell
>
> anchors.top: rowname.bottom
>
> text: '<b>Cell:</b>' + cell
>
> }
>
> }
>
> }
>
>
> ListView
>
> {
>
> id: listpeople
>
> anchors { fill: parent; margins: 22 }
>
> model: listdata
>
> delegate: listdelegate
>
> highlight: Rectangle { color : "lightsteelblue"; radius : 5 }
>
> focus: true
>
> }
>
>
> }
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140813/beb04aa4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testloader.zip
Type: application/zip
Size: 5732 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140813/beb04aa4/attachment.zip>
More information about the Interest
mailing list