Mark, 

You can give each of your Desk elements an id and use that to access the 
element.

> FWIW I switch between them like this below

For the key navigation maybe this will help
http://doc.qt.nokia.com/4.7/qml-keynavigation.html

>  I don't want to use ListElements which are destroyed when they are 
> out of view

You should be able to avoid that. See
http://doc.qt.nokia.com/4.7/qml-gridview.html#cacheBuffer-prop
or
http://doc.qt.nokia.com/4.7/qml-gridview.html#delayRemove-prop


Cheers
Mathias

________________________________________
From: [email protected] 
[[email protected]] on behalf of ext Mark 
Constable [[email protected]]
Sent: Tuesday, January 04, 2011 5:08 AM
To: [email protected]
Subject: Re: [Qt-qml] How to update item within a Row

On 2011-01-03, Abhishek wrote:
> As i understand(check qt/src/graphicsitems/qdeclarativerepeater.cpp)
> *Repeater* will create all element dynamically so no Id for each
> item and also there is no method or property which returns the list
> of item created by Repeater and same goes to Row, it also doesn't
> have any method or property to give the list of Item in Row so one
> cant Iterate over and find the Item at given Index.

Newb attempt #2. So if I at least avoid using Repeater and hard
wire some Components then how do I reference any one of them
from the outside? I want to dynamically load up these "desktop"
containers with "applications" ie; the demos/declarative/rssnews
example into, say, "Desktop 2".

  Row {
    id: desk
    width: rootWidth
    height: rootHeight
    Desk { x: rootWidth * 0; deskTitle: "<h1>Desktop 1</h1>" }
    Desk { x: rootWidth * 1; deskTitle: "<h1>Desktop 2</h1>" }
    Desk { x: rootWidth * 2; deskTitle: "<h1>Desktop 3</h1>" }
    // [... * 10]
  }

// Desk.qml
import QtQuick 1.0
Rectangle {
  property alias deskTitle: title.text
  width: rootWidth
  height: rootHeight
  color: "#3f3f3f"
  Text {
    id: title
    anchors.centerIn: parent
  }
}

FWIW I switch between them like this below. I don't want to use
ListElements which are destroyed when they are out of view because
the "applications" could still be active and pulling in feeds in
the case of rssnews.

  property int current: 0

  Keys.onPressed: {
    switch(event.key) {
    case Qt.Key_Right: {
      current = (current == 9) ? 0 : current+1
      desk.x = -(rootWidth * current) } break;
    case Qt.Key_Left: {
      current = (current == 0) ? 9 : current-1
      desk.x = -(rootWidth * current) } break;
    }
  }

--markc
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to