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. Mouse area question
QtWS25 Last Chance

Mouse area question

Scheduled Pinned Locked Moved Solved QML and Qt Quick
1 Posts 1 Posters 110 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.
  • LahearleL Offline
    LahearleL Offline
    Lahearle
    wrote on last edited by
    #1

    I have a sidebar menu with buttons that toggle, and on toggling to true they open their own little menus with buttons in them.

    I wanted to just slap a mouse area on the main window so when leftclicked, it just untoggles all the buttons to close all the mini menus, but for some reason it's not working.

    it works if I use onPressed, but obviously does not stay because as soon as it's not pressed it goes back. onClicked does not seem to work.

    I was gonna replace it with an invisible button as I think that would be easire and maybe mouse area is just better suit for focus change, but I wanted to ask here first.

    basically it's like this:

    Button { toggle true blabla }
    StateGroup { when button toggled make mini menu visible }
    MouseArea { stretched to fit main window }
    StateGroup { When mouse area is pressed, change Button to be toggled false }

    like I said pressed works, clicked does NOT
    and if you are wondering why I am using state groups for each individual state it's because of visiblity scope issues.

    I was gonna make it cancel the toggle AND the state thinking the states were still activated> button reactivates on press?

    Just need a chad to slide me some exper MouseArea info right now for the dirt

    :)

    1 Reply Last reply
    0
    • LahearleL Lahearle has marked this topic as solved on

    • Login

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