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. Is it possible to make a scrolling interface without the ListView

Is it possible to make a scrolling interface without the ListView

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 5 Posters 498 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #1

    Hi!
    I make the interface scroll vertically. Tried to use ListView, but ListView is buggy.
    Is it possible to make a scrolling interface without the ListView?

    K 1 Reply Last reply
    0
    • M Mikeeeeee

      Hi!
      I make the interface scroll vertically. Tried to use ListView, but ListView is buggy.
      Is it possible to make a scrolling interface without the ListView?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Mikeeeeee

      Did you have a look to ScrollView https://doc.qt.io/qt-5/qml-qtquick-controls2-scrollview.html
      or https://doc.qt.io/qt-5/qml-qtquick-controls-scrollview.html ?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mikeeeeee
        wrote on last edited by
        #3

        If I use ScrollView , the screen does not scroll

         {
                anchors.right: parent.right
                anchors.rightMargin: 0
                anchors.left: parent.left
                anchors.leftMargin: 0
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 0
                anchors.top: parent.top
                anchors.topMargin: 0
        
        
        
        
            Rectangle {
                id: rectangle
                height: 19
                color: "#e3ded3"
                anchors.right: parent.right
                anchors.rightMargin: 0
                anchors.left: parent.left
                anchors.leftMargin: 0
                anchors.top: parent.top
                anchors.topMargin: 0
        
                Text {
                    id: element1
                    x: 78
                    y: 4
                    width: 214
                    height: 14
                    text: qsTr("8 (800) 700 0002 - отдел продаж")
                    anchors.horizontalCenter: parent.horizontalCenter
                    anchors.verticalCenter: parent.verticalCenter
                    font.pixelSize: 12
                }
            }
        
            Rectangle {
                id: rectangle1
                height: mainElement.height * 0.15
                color: "#ffffff"
                anchors.top: rectangle.bottom
                anchors.topMargin: 0
                anchors.right: parent.right
                anchors.rightMargin: 0
                anchors.left: parent.left
                anchors.leftMargin: 0
        
                Image {
                    id: imageLabel
                    width: parent.width * 0.75
                    anchors.left: parent.left
                    anchors.leftMargin: 0
                    anchors.bottom: parent.bottom
                    anchors.bottomMargin: 0
                    anchors.top: parent.top
                    anchors.topMargin: 0
                    fillMode: Image.PreserveAspectFit
                    source: "qrc:/Images/Images/Xwd9C1BM5QA.jpg"
                }
        
                Button {
                    id: buttonMenu
        //            x: 314
        //            y: 37
                    anchors.left: imageLabel.right
                    anchors.right: parent.right
                    width: parent.height * 0.5
                    height: parent.height * 0.8
                    text: qsTr("")
                    anchors.rightMargin: parent.height * 0.2
                    anchors.leftMargin: parent.height * 0.2
                    anchors.verticalCenter: parent.verticalCenter
                    background: Rectangle{
                        color: "white"
                    }
        
        
                    /*contentItem: Text {
                                       text: page0Button0.text
                                       font: page0Button0.font
                                       opacity: enabled ? 1.0 : 0.3
                                       color: page0Button0.pressed ? "black" : "black"
                                       horizontalAlignment: Text.AlignHCenter
                                       verticalAlignment: Text.AlignVCenter
                                       elide: Text.ElideRight
                                   }
        
                                   background: Rectangle {
                                       implicitWidth: 90
                                       implicitHeight: 30
                                       opacity: enabled ? 1 : 0.3
                                       border.color:  "black"
                                       color:  "white"
                                       border.width: 1
                                       radius: 0
                                   }*/
        
                    Image {
                        id: image1
                        anchors.fill: parent
                        fillMode: Image.PreserveAspectFit
                        source: "qrc:/Images/Images/menuRed.png"
                    }
                }
            }
        
            Rectangle {
                id: rectangle2
                x: 141
                y: 143
                width: 99
                height: 26
                color: "#db4c4c"
                radius: height * 0.3
        
                MouseArea {
                    id: mouseAreaRassrochka
                    anchors.bottomMargin: 0
                    anchors.fill: parent
        
                    Text {
                        id: element2
                        x: 82
                        y: parent.height * 0.05
                        //width: 5
                        height: 7
                        text: qsTr("Продаем")
                        font.weight: Font.ExtraBold
                        font.capitalization: Font.MixedCase
                        font.family: "Times New Roman"
                        elide: Text.ElideLeft
                        color: "white"
                        anchors.horizontalCenter: parent.horizontalCenter
                        font.pixelSize: parent.height * 0.4
                    }
        
                    Text {
                        id: element3
                        x: 87
                        y: parent.height * 0.45
                        text: qsTr("в рассрочку!")
                        font.weight: Font.ExtraBold
                        font.family: "Times New Roman"
                        font.capitalization: Font.MixedCase
                        color: "white"
                        anchors.horizontalCenterOffset: 0
                        anchors.horizontalCenter: parent.horizontalCenter
                        font.pixelSize: parent.height * 0.4
                    }
                }
            }
        
            Rectangle{
                color: "red"
                width: 200
                height: 200
                y: 650
            }
        
        
        
        
        }
        //    }
        //ListElement{
        
        //}
        
        
        }
        
        ODБOïO jsulmJ 2 Replies Last reply
        0
        • M Mikeeeeee

          If I use ScrollView , the screen does not scroll

           {
                  anchors.right: parent.right
                  anchors.rightMargin: 0
                  anchors.left: parent.left
                  anchors.leftMargin: 0
                  anchors.bottom: parent.bottom
                  anchors.bottomMargin: 0
                  anchors.top: parent.top
                  anchors.topMargin: 0
          
          
          
          
              Rectangle {
                  id: rectangle
                  height: 19
                  color: "#e3ded3"
                  anchors.right: parent.right
                  anchors.rightMargin: 0
                  anchors.left: parent.left
                  anchors.leftMargin: 0
                  anchors.top: parent.top
                  anchors.topMargin: 0
          
                  Text {
                      id: element1
                      x: 78
                      y: 4
                      width: 214
                      height: 14
                      text: qsTr("8 (800) 700 0002 - отдел продаж")
                      anchors.horizontalCenter: parent.horizontalCenter
                      anchors.verticalCenter: parent.verticalCenter
                      font.pixelSize: 12
                  }
              }
          
              Rectangle {
                  id: rectangle1
                  height: mainElement.height * 0.15
                  color: "#ffffff"
                  anchors.top: rectangle.bottom
                  anchors.topMargin: 0
                  anchors.right: parent.right
                  anchors.rightMargin: 0
                  anchors.left: parent.left
                  anchors.leftMargin: 0
          
                  Image {
                      id: imageLabel
                      width: parent.width * 0.75
                      anchors.left: parent.left
                      anchors.leftMargin: 0
                      anchors.bottom: parent.bottom
                      anchors.bottomMargin: 0
                      anchors.top: parent.top
                      anchors.topMargin: 0
                      fillMode: Image.PreserveAspectFit
                      source: "qrc:/Images/Images/Xwd9C1BM5QA.jpg"
                  }
          
                  Button {
                      id: buttonMenu
          //            x: 314
          //            y: 37
                      anchors.left: imageLabel.right
                      anchors.right: parent.right
                      width: parent.height * 0.5
                      height: parent.height * 0.8
                      text: qsTr("")
                      anchors.rightMargin: parent.height * 0.2
                      anchors.leftMargin: parent.height * 0.2
                      anchors.verticalCenter: parent.verticalCenter
                      background: Rectangle{
                          color: "white"
                      }
          
          
                      /*contentItem: Text {
                                         text: page0Button0.text
                                         font: page0Button0.font
                                         opacity: enabled ? 1.0 : 0.3
                                         color: page0Button0.pressed ? "black" : "black"
                                         horizontalAlignment: Text.AlignHCenter
                                         verticalAlignment: Text.AlignVCenter
                                         elide: Text.ElideRight
                                     }
          
                                     background: Rectangle {
                                         implicitWidth: 90
                                         implicitHeight: 30
                                         opacity: enabled ? 1 : 0.3
                                         border.color:  "black"
                                         color:  "white"
                                         border.width: 1
                                         radius: 0
                                     }*/
          
                      Image {
                          id: image1
                          anchors.fill: parent
                          fillMode: Image.PreserveAspectFit
                          source: "qrc:/Images/Images/menuRed.png"
                      }
                  }
              }
          
              Rectangle {
                  id: rectangle2
                  x: 141
                  y: 143
                  width: 99
                  height: 26
                  color: "#db4c4c"
                  radius: height * 0.3
          
                  MouseArea {
                      id: mouseAreaRassrochka
                      anchors.bottomMargin: 0
                      anchors.fill: parent
          
                      Text {
                          id: element2
                          x: 82
                          y: parent.height * 0.05
                          //width: 5
                          height: 7
                          text: qsTr("Продаем")
                          font.weight: Font.ExtraBold
                          font.capitalization: Font.MixedCase
                          font.family: "Times New Roman"
                          elide: Text.ElideLeft
                          color: "white"
                          anchors.horizontalCenter: parent.horizontalCenter
                          font.pixelSize: parent.height * 0.4
                      }
          
                      Text {
                          id: element3
                          x: 87
                          y: parent.height * 0.45
                          text: qsTr("в рассрочку!")
                          font.weight: Font.ExtraBold
                          font.family: "Times New Roman"
                          font.capitalization: Font.MixedCase
                          color: "white"
                          anchors.horizontalCenterOffset: 0
                          anchors.horizontalCenter: parent.horizontalCenter
                          font.pixelSize: parent.height * 0.4
                      }
                  }
              }
          
              Rectangle{
                  color: "red"
                  width: 200
                  height: 200
                  y: 650
              }
          
          
          
          
          }
          //    }
          //ListElement{
          
          //}
          
          
          }
          
          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by
          #4

          @Mikeeeeee hi
          you can use flickable also

          J.HilkJ 1 Reply Last reply
          2
          • ODБOïO ODБOï

            @Mikeeeeee hi
            you can use flickable also

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            when using flickable, like @LeLev suggested,
            don't forget to set a size to contentWidth and/or height or it won't scroll either


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            2
            • M Mikeeeeee

              If I use ScrollView , the screen does not scroll

               {
                      anchors.right: parent.right
                      anchors.rightMargin: 0
                      anchors.left: parent.left
                      anchors.leftMargin: 0
                      anchors.bottom: parent.bottom
                      anchors.bottomMargin: 0
                      anchors.top: parent.top
                      anchors.topMargin: 0
              
              
              
              
                  Rectangle {
                      id: rectangle
                      height: 19
                      color: "#e3ded3"
                      anchors.right: parent.right
                      anchors.rightMargin: 0
                      anchors.left: parent.left
                      anchors.leftMargin: 0
                      anchors.top: parent.top
                      anchors.topMargin: 0
              
                      Text {
                          id: element1
                          x: 78
                          y: 4
                          width: 214
                          height: 14
                          text: qsTr("8 (800) 700 0002 - отдел продаж")
                          anchors.horizontalCenter: parent.horizontalCenter
                          anchors.verticalCenter: parent.verticalCenter
                          font.pixelSize: 12
                      }
                  }
              
                  Rectangle {
                      id: rectangle1
                      height: mainElement.height * 0.15
                      color: "#ffffff"
                      anchors.top: rectangle.bottom
                      anchors.topMargin: 0
                      anchors.right: parent.right
                      anchors.rightMargin: 0
                      anchors.left: parent.left
                      anchors.leftMargin: 0
              
                      Image {
                          id: imageLabel
                          width: parent.width * 0.75
                          anchors.left: parent.left
                          anchors.leftMargin: 0
                          anchors.bottom: parent.bottom
                          anchors.bottomMargin: 0
                          anchors.top: parent.top
                          anchors.topMargin: 0
                          fillMode: Image.PreserveAspectFit
                          source: "qrc:/Images/Images/Xwd9C1BM5QA.jpg"
                      }
              
                      Button {
                          id: buttonMenu
              //            x: 314
              //            y: 37
                          anchors.left: imageLabel.right
                          anchors.right: parent.right
                          width: parent.height * 0.5
                          height: parent.height * 0.8
                          text: qsTr("")
                          anchors.rightMargin: parent.height * 0.2
                          anchors.leftMargin: parent.height * 0.2
                          anchors.verticalCenter: parent.verticalCenter
                          background: Rectangle{
                              color: "white"
                          }
              
              
                          /*contentItem: Text {
                                             text: page0Button0.text
                                             font: page0Button0.font
                                             opacity: enabled ? 1.0 : 0.3
                                             color: page0Button0.pressed ? "black" : "black"
                                             horizontalAlignment: Text.AlignHCenter
                                             verticalAlignment: Text.AlignVCenter
                                             elide: Text.ElideRight
                                         }
              
                                         background: Rectangle {
                                             implicitWidth: 90
                                             implicitHeight: 30
                                             opacity: enabled ? 1 : 0.3
                                             border.color:  "black"
                                             color:  "white"
                                             border.width: 1
                                             radius: 0
                                         }*/
              
                          Image {
                              id: image1
                              anchors.fill: parent
                              fillMode: Image.PreserveAspectFit
                              source: "qrc:/Images/Images/menuRed.png"
                          }
                      }
                  }
              
                  Rectangle {
                      id: rectangle2
                      x: 141
                      y: 143
                      width: 99
                      height: 26
                      color: "#db4c4c"
                      radius: height * 0.3
              
                      MouseArea {
                          id: mouseAreaRassrochka
                          anchors.bottomMargin: 0
                          anchors.fill: parent
              
                          Text {
                              id: element2
                              x: 82
                              y: parent.height * 0.05
                              //width: 5
                              height: 7
                              text: qsTr("Продаем")
                              font.weight: Font.ExtraBold
                              font.capitalization: Font.MixedCase
                              font.family: "Times New Roman"
                              elide: Text.ElideLeft
                              color: "white"
                              anchors.horizontalCenter: parent.horizontalCenter
                              font.pixelSize: parent.height * 0.4
                          }
              
                          Text {
                              id: element3
                              x: 87
                              y: parent.height * 0.45
                              text: qsTr("в рассрочку!")
                              font.weight: Font.ExtraBold
                              font.family: "Times New Roman"
                              font.capitalization: Font.MixedCase
                              color: "white"
                              anchors.horizontalCenterOffset: 0
                              anchors.horizontalCenter: parent.horizontalCenter
                              font.pixelSize: parent.height * 0.4
                          }
                      }
                  }
              
                  Rectangle{
                      color: "red"
                      width: 200
                      height: 200
                      y: 650
                  }
              
              
              
              
              }
              //    }
              //ListElement{
              
              //}
              
              
              }
              
              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Mikeeeeee said in Is it possible to make a scrolling interface without the ListView:

              If I use ScrollView

              where do you use it?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mikeeeeee
                wrote on last edited by
                #7

                I just put the ScrollView in the body and put the rest of the code in the ScrollView.
                Flickable help me.

                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