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. "ReferenceError: mouse is not defined" in MouseArea
QtWS25 Last Chance

"ReferenceError: mouse is not defined" in MouseArea

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
mouseareamouse
4 Posts 2 Posters 4.1k 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.
  • qwasder85Q Offline
    qwasder85Q Offline
    qwasder85
    wrote on last edited by
    #1

    I'm getting this reference error in my QML file and don't understand why. Here's the lines in question:

    import QtQuick 2.5
    import QtQuick.Window 2.2
    import QtQuick.Layouts 1.1
    import QtGraphicalEffects 1.0
    
    ...
    
    MouseArea {
        id: sideBarMouseArea
    
        anchors.fill:               parent
        hoverEnabled:               true
        propagateComposedEvents:    true
    
        onEntered: {
            mouse.accepted = false
        }
    }
    

    Can anyone point out what I missed? Thanks.

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

      Hi,

      onEntered doesn't provide a mouse parameter.

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

      qwasder85Q 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        onEntered doesn't provide a mouse parameter.

        qwasder85Q Offline
        qwasder85Q Offline
        qwasder85
        wrote on last edited by
        #3

        @SGaist Oh, so that's what it is. Thank you!

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

          You're welcome !

          Since the mystery is gone, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)

          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