Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to Scroll one text and other in static using qml repeater??
Qt 6.12 LTS is out! See what's new in the release blog

How to Scroll one text and other in static using qml repeater??

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 890 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.
  • BharathiB Offline
    BharathiB Offline
    Bharathi
    wrote on last edited by p3c0
    #1

    Using Number animation I can able to scroll the single text or one more text in repeater.But I want to show that a single text is on scrolling and other in static.Any suggestions.
    Here is my code

    Rectangle
    {
        id:root
        x:0
        y:0
        width:1024
        height:786
    
    Repeater{
        id:rootmodel
        model:2
    
    Text{
        id:text
        x:parent.width/2-text.width/2-xval[index]
        y:parent.height/2-text.height/2-yval[index]
        anchors.centerIn: parent.Center
        text:source[index];
        font.pointSize:200
    
        NumberAnimation on x
        {
            id:animate
            running:false
            from: root.width
            to: -1*text.width
            loops: Animation.Infinite
            duration: 16000
        }
    }
    }
    Timer{
        id:timer
        interval: 1000
        repeat: true
        running: true
        onTriggered:
        {
          if(rootmodel.count>1)
          {
              rootmodel.itemAt(0).running=true;
    
          }
    
        }
    }
    
    }
    

    Edit: Added code tags - p3c0

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Bharathi How about adding a condition in NumberAnimation itself? For eg.

      running: index==1 ? true:false //animates Item at index 1
      

      157

      1 Reply Last reply
      1

      • Login

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