Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem with itemAt function in repeater element
Qt 6.11 is out! See what's new in the release blog

Problem with itemAt function in repeater element

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have the following QML file:

    @import QtQuick 1.0

    (...) // non-relevant Code

    Repeater {
    id: livesRepeater
    model: 3

    Image {
    source: "images/love.png"
    height: parent.height
    width: height

    Behavior on opacity {
    NumberAnimation {
    duration: 250
    }
    }
    }
    }

    function fillLives() {
    for (var i=0; i<livesRepeater.count; i++) {
    livesRepeater.itemAt(i).opacity = 1
    }
    }
    @

    And in the fillLives function, I'm getting the following error "TypeError: Result of expression 'livesRepeater.itemAt' [undefined] is not a function."

    However, this only happens when I test the app in Symbian^1 devices, in Symbian^3 works without problems.

    Anyone knows why? Is there some alternative to do it in Symbian^1?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi,

      "itemAt":http://qt-project.org/doc/qt-4.8/qml-repeater.html#itemAt-method was added in QtQuick 1.1 so it won't work on devices with Symbian^1 because the newest version of Qt libs possible to install on those devices is Qt 4.7.3 with QtQuick 1.0.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved