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. Switchview and Switch
QtWS25 Last Chance

Switchview and Switch

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 244 Views
  • 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.
  • R Offline
    R Offline
    remco1271
    wrote on last edited by
    #1

    I made a switchview with multiple pages but when I press on the button it starts moving to the most left view.
    It will not stop moving to the page on the left every 2 second.

    import QtQuick 2.0
    import CustomComponents 1.0
    import QtQuick.Controls 2.0
    Rectangle {
        id: mainview
        x:0;y:0;width:480;height:272;
        color: "#ffffff"
        visible: true
    
        SwipeView {
            id: view
            currentIndex: 1
            anchors.fill: parent
            
            Page1{
                x:0
                y:0
                width:480
                height:272
            }
            Page2{
                x:0
                y:0
                width:480
                height:272
            }
            Item {
                width:480
                height:272
    
                Switch {
                    id: swGreenLED
                    x: 50
                    y: 80
                    z: 50
                    text: qsTr("Green")
                    checked: false
                }
            }
        }
    }
    
    MarkkyboyM 1 Reply Last reply
    0
    • R remco1271

      I made a switchview with multiple pages but when I press on the button it starts moving to the most left view.
      It will not stop moving to the page on the left every 2 second.

      import QtQuick 2.0
      import CustomComponents 1.0
      import QtQuick.Controls 2.0
      Rectangle {
          id: mainview
          x:0;y:0;width:480;height:272;
          color: "#ffffff"
          visible: true
      
          SwipeView {
              id: view
              currentIndex: 1
              anchors.fill: parent
              
              Page1{
                  x:0
                  y:0
                  width:480
                  height:272
              }
              Page2{
                  x:0
                  y:0
                  width:480
                  height:272
              }
              Item {
                  width:480
                  height:272
      
                  Switch {
                      id: swGreenLED
                      x: 50
                      y: 80
                      z: 50
                      text: qsTr("Green")
                      checked: false
                  }
              }
          }
      }
      
      MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by
      #2

      @remco1271 - possibly because you have 'currentIndex: 1', try setting to '-1' instead.

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      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