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. Please help me with states in Qt Design Studio
Forum Updated to NodeBB v4.3 + New Features

Please help me with states in Qt Design Studio

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 165 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.
  • M Offline
    M Offline
    Mlibu
    wrote on last edited by Mlibu
    #1

    Hi there, I would like some help with states please. I am working on a new project, and I'm really trying as hard as I can to use Qt Design Studio for as much of the front end as I can and hopefully only use C++ for business logic.

    • I would like to have 4 buttons made from a border rect, a background rect, and a centered text.
    • Each button is made from the same component.
    • When each button is hovered over (entered), the border should go from 0.3 opacity to 0.5 opacity.
    • When each button is exited, the border should return to 0.3 opacity.
    • When a button is clicked, its background should go from 0.1 opacity to 0.8 opacity. Also any other button that had been clicked should go back to 0.1 opacity (return to unselected) so that only one of the four buttons are selected at a time.
    • When the mouse leaves the clicked button, the border should go back to 0.3 percent opacity (ie. the exit should take effect without effecting the selection)
    • Any button that is hovered over should still continue to have a highlighted border, with the selected button bg still at 0.8 opacity. In other words, the border rect should still respond the same to enter and exit even though the background bg should not change at all until another button is clicked.

    The thing that is tricking me up is how to go to a 'hovered but unselected' state for an unselected button but a 'hovered and selected' state for the selected button. Furthermore, once one button is selected by a click, how do I unselect that button when the second button is selected and keep it to one button selected? I have read the documentation on how to use states but there is nothing explained in this detail and complexity, thank you.

    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