Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Weird mouse behaviour in Qt 5.8
QtWS25 Last Chance

Weird mouse behaviour in Qt 5.8

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 1.7k 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.
  • E Offline
    E Offline
    ehsanen
    wrote on last edited by
    #1

    I have updated to Qt 5.8. I have a bunch of SplitViews and some special controls that change the mouse cursor when mouse goes over them. With Qt 5.7 everything worked fine, but now I see a weird behaviour:

    • If the mouse is within the area of the application at initial run, then none of the cursor changes work. I have to move the mouse to one of the borders, so the cursor once changes to resizing mode and after that everything works normally.

    • If the mouse is not within the area of the application at initial run, as I have to drag the mouse over the borders into the application, everything works fine.

    Is it a known issue?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! You can go to https://bugreports.qt.io and see there if this is a known issue. If it's not, then maybe you can post a minimal example here, so other users can try to reproduce it.

      1 Reply Last reply
      3
      • E Offline
        E Offline
        ehsanen
        wrote on last edited by ehsanen
        #3

        With more tests I noticed that, this bug occurs only when running the application from within the Qt Creator. If I build first and then run the app by double clicking the binary, it won't happen.
        Reproducing is actually pretty easy, here is a simple example:

        
        ApplicationWindow {
                visible: true
                width: 500
                height: 500
        
        Item {
            Rectangle {
                x: 100
                y: 100
                width: 150
                height: 150
                color: "grey"
                MouseArea {
                    id: rectmouse
                    anchors.fill: parent
                    hoverEnabled: true
                    onEntered: {
                        rectmouse.cursorShape = Qt.SizeHorCursor
                    }
                    onExited: {
                        rectmouse.cursorShape = Qt.ArrowCursor
                    }
                }
            }
        }
        
        

        There is a rectangle in the main window on mouse enter/exit it is supposed to change the mouse cursor. If you run this, and remember the mouse cursor should be within the area of the app when the app opens. Then none of the cursor changes work. If the mouse is out of the app area and you bring it in, cursor changes work normally.
        Anyway, as it is just reproducible when I run from Qt Creator and will not affect the end user, I don't count it as a critical bug.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Then are you sure that your application is loading the same version of Qt when you start it outside Qt Creator ?

          What OS are you running ?
          Did you do the deployment steps before starting your application ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • E Offline
            E Offline
            ehsanen
            wrote on last edited by
            #5

            I am using OS X Yosemite. I did not do the deployment process as I am running it locally, and Qt is already installed on my local system.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Ok, then it's likely something else...

              Just to be sure, can you run otool -L on your application executable ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • E Offline
                E Offline
                ehsanen
                wrote on last edited by
                #7

                Here is otool's output:

                /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
                /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 73.0.0)
                /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0)
                /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
                /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
                	@rpath/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.8.0, current version 5.8.0)
                	@rpath/QtQml.framework/Versions/5/QtQml (compatibility version 5.8.0, current version 5.8.0)
                	@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.8.0, current version 5.8.0)
                	@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0)
                /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
                /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
                	@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0)
                	@rpath/QtMultimedia.framework/Versions/5/QtMultimedia (compatibility version 5.8.0, current version 5.8.0)
                	@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0)
                /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
                /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
                /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
                /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
                
                
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Ok looks good,

                  You don't have any other Qt 5 installed on your system ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    ehsanen
                    wrote on last edited by
                    #9

                    I also have Qt 5.7 installed, but when building in Qt Creator I select Qt 5.8 kit. And the app binary seems to completely link to Qt 5.8!

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Then that looks even better.

                      Does it happen both in debug and release mode ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        ehsanen
                        wrote on last edited by
                        #11

                        Yes happens in both modes. Have you tried reproducing it?

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Yes and I am not able to reproduce this.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          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