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. [SOLVED] Is onExited: name2.state = "" valid? (State changes using onExited with hover enabled on mouse areas)
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Is onExited: name2.state = "" valid? (State changes using onExited with hover enabled on mouse areas)

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 2.1k 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.
  • Q Offline
    Q Offline
    QtQitten
    wrote on last edited by
    #1

    Hi guys,

    Hopefully a quick one:

    Say we have have an item with id of 'name2' and two states of 'default' and 'State1' Over that we apply:

    @
    MouseArea {
    id: name
    width: name2.width
    height: name2.height
    opacity: 0
    hoverEnabled: true
    onExited: name2.state = ""
    }
    @

    Alas this seems to have no effect. Have I made a syntax error? Or is there a better way to do this? I have affected image sources using onHover and Exit to good effect on menus and other items just fathoming how to use the same idea to effect states.

    Thanks for your help.

    If anyone wants to code model for using hover to change image for their menus let me know and will post.

    [EDIT: code formatting, please wrap in @-tags, Volker]

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ixSci
      wrote on last edited by
      #2

      Hi QtQitten, it should work. Show us a complete example so we can say more. BTW, remove opacity:0 from MouseArea because it is not needed here and it may cause such a behavior

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        If you set <code>opactiy: 0</code> on a MouseArea it won't recieve any events.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          QtQitten
          wrote on last edited by
          #4

          Unsure where that opacity snuck in... Code is behaving normally now. I am surprised MouseArea accepts an opacity value where it has this effect.

          Thank's for the sanity check both.

          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