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. "swipe" navigation through ChartView
Forum Updated to NodeBB v4.3 + New Features

"swipe" navigation through ChartView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 386 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.
  • G Offline
    G Offline
    Grisu
    wrote on last edited by
    #1

    Hi
    I want to navigate through data shown in a ChartView. On swipe left or tap on the left half of the View I want to show the data from the pre2vious day.
    And ideas?

    Sebastian

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Astrinus
      wrote on last edited by
      #2

      If you lift the requirement of tapping, you can simply nest the ChartView inside a ScrollView.
      If you want also tapping, you should also instantiate a TapHandler and hook into onSingleTapped.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Grisu
        wrote on last edited by
        #3

        Hi
        I think I haven't explained it properly.
        I've got two buttons "back" and "continue" to change the date of data shown in the chart.
        For better usability I also want to swipe left or right on the Chart to change the Date.
        I don't think the ScrollView is the right Widget.

        This is part of my code:

            Rectangle {
                id: rectangle
                anchors.fill: parent
                color: "black"
                    GridLayout {
                        id: gridLayout
                        anchors.fill: parent
                        columns: 3
        
                        Button {
                            id: butBack
                            icon.source: "images/back.png"
                        }
        
                        Button {
                            id: butDate
                            text: qsTr("Date")
                            Layout.fillWidth: true
                            transformOrigin: Item.Center
                        }
        
                        Button {
                            id: butContinue
                            display: AbstractButton.IconOnly
                            icon.source: "media/Continue.png"
                        }
                        ChartView {
                            id: chartView
                            Layout.columnSpan: 3
                            Layout.fillHeight: true
                            Layout.fillWidth: true
                            antialiasing: true
                            theme: ChartView.ChartThemeDark
                        }
                }
            }
        
        
        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