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. Flickable onMouseXChanged
Qt 6.11 is out! See what's new in the release blog

Flickable onMouseXChanged

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 2 Posters 2.5k 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.
  • D Offline
    D Offline
    Dmitry89
    wrote on last edited by
    #1

    How can I catch this event in a flickable item? I can't find a method to get access to the flickables mousearea item

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

      Hi,

      Did you add MouseArea to the Flickable ? onMouseXChanged should work in it.

      157

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dmitry89
        wrote on last edited by
        #3

        MouseArea blocks flickables mousearea, so I can't use it

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

          Why don't you use the Flickable's MouseArea ? In this way you will be able to onMouseXChanged in it. Or May be if i'm not understanding it can you post an example of the scenario ?

          157

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Dmitry89
            wrote on last edited by
            #5

            I don't use it, because I don't know how can I get access to this MouseArea. Could you tell me how can I do it?

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

              Just add MouseArea in it like you add in others.
              @
              Flickable {
              MouseArea {
              }
              }
              @

              157

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dmitry89
                wrote on last edited by
                #7

                Thanks, it works
                My mistake was that I parented the MouseArea to the ScrollView instead of ScrollView's Flickable

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

                  Ok. And don't forget to add anchors.fill: parent in MouseArea so that it covers the whole Flickable Item. You can mark the post as solved.

                  157

                  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