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 seems broken on Linux/X11 with mouse
Forum Updated to NodeBB v4.3 + New Features

Flickable seems broken on Linux/X11 with mouse

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 498 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.
  • J Offline
    J Offline
    jimav
    wrote on last edited by jimav
    #1

    I tried the example at https://doc.qt.io/qt-5/qml-qtquick-flickable.html#example-usage and it does not seem to work at all on a Linux/X11 desktop.

    I can drag the viewport into the image somewhat (but not smoothly), but letting go of the mouse button makes the viewport "snap back" to its starting position. The behavior is nothing like "flicking".

    Is Flickable only supposed to be used on touch-screens?

    Here is the example code (modified slightly to use a wikimedia image):

    import QtQuick 2.12
    import QtQuick.Controls 2.12
    
    ApplicationWindow {
      visible:true
      width:500; height:500
    
      Flickable {
        width: 1000; height: 1000
        contentWidth: image.width; contentHeight: image.height
    
        Image { id: image; source: "https://upload.wikimedia.org/wikipedia/commons/e/e4/Moon_merged_small.jpg" }
      }
    }
    
    J.HilkJ 1 Reply Last reply
    0
    • Nikhilesh NN Offline
      Nikhilesh NN Offline
      Nikhilesh N
      wrote on last edited by
      #2

      @jimav, it differs between computers and their computing power. Flicking also depends on the resolution of the image and its size. Try it out with a picture of a much lesser resolution. It'll turn out smoother.

      Even I had a very slight problem with regards of smoothness while dragging such a big picture you used as your example here, but it used to go back to its origin smoothly without snapping back.

      J 1 Reply Last reply
      0
      • Nikhilesh NN Nikhilesh N

        @jimav, it differs between computers and their computing power. Flicking also depends on the resolution of the image and its size. Try it out with a picture of a much lesser resolution. It'll turn out smoother.

        Even I had a very slight problem with regards of smoothness while dragging such a big picture you used as your example here, but it used to go back to its origin smoothly without snapping back.

        J Offline
        J Offline
        jimav
        wrote on last edited by
        #3

        @Nikhilesh-N The problem is that it is impossible to reposition the viewport at all (it snaps back to 0,0 the moment you let go of the mouse button).

        BTW, I'm running Ubuntu 18.10/X11 on a 6-core i7-8700K CPU @ 3.70GHz (albeit using built-in Intel graphics)

        1 Reply Last reply
        0
        • J jimav

          I tried the example at https://doc.qt.io/qt-5/qml-qtquick-flickable.html#example-usage and it does not seem to work at all on a Linux/X11 desktop.

          I can drag the viewport into the image somewhat (but not smoothly), but letting go of the mouse button makes the viewport "snap back" to its starting position. The behavior is nothing like "flicking".

          Is Flickable only supposed to be used on touch-screens?

          Here is the example code (modified slightly to use a wikimedia image):

          import QtQuick 2.12
          import QtQuick.Controls 2.12
          
          ApplicationWindow {
            visible:true
            width:500; height:500
          
            Flickable {
              width: 1000; height: 1000
              contentWidth: image.width; contentHeight: image.height
          
              Image { id: image; source: "https://upload.wikimedia.org/wikipedia/commons/e/e4/Moon_merged_small.jpg" }
            }
          }
          
          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by J.Hilk
          #4

          @jimav
          the issue is that image size (even sourceSize) is smaller than your 1000 x 1000 flickable, that's the reason why it jumps back.
          You're technically out of bounds.

          Why that's the case, I don't know :(


          actually the reason is that you give your flickable a fixed height and width.
          This fixes the issue:

          import QtQuick 2.12
          import QtQuick.Controls 2.12
          
          ApplicationWindow {
            visible:true
            width:500; height:500
          
            Flickable {
              anchors.fill: parent
              contentWidth: image.sourceSize.height; contentHeight: image.sourceSize.height
          
              onContentWidthChanged: console.log(contentWidth, image.sourceSize)
          
               Image { id: image; source: "https://upload.wikimedia.org/wikipedia/commons/e/e4/Moon_merged_small.jpg" }
          
            }
          }
          
          

          no idea why that is causing havoc.


          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

          • Login

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