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. How to create an animated button widget of complex shape?
QtWS25 Last Chance

How to create an animated button widget of complex shape?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 484 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I'm trying to implement a button that has a complex shape, 3 different states and transition animations (example picture below). I'm not really familiar with the framework so far and am still a little bit overwhelmed by all the tools and libraries. That's why I wanted to ask for a hint in the right direction here.

    If you had to implement such a button to be used in a qt widgets application, what would be your approach? I'm not looking for a step by step guide but rather the general topics I'd have to look into here.

    SpinnerButton.png

    Pl45m4P 1 Reply Last reply
    0
    • ? A Former User

      I'm trying to implement a button that has a complex shape, 3 different states and transition animations (example picture below). I'm not really familiar with the framework so far and am still a little bit overwhelmed by all the tools and libraries. That's why I wanted to ask for a hint in the right direction here.

      If you had to implement such a button to be used in a qt widgets application, what would be your approach? I'm not looking for a step by step guide but rather the general topics I'd have to look into here.

      SpinnerButton.png

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Hari-Seldon

      Make a custom QWidget with 5 custom buttons. I guess just one QPushButton wont be enough because you need 5 different zones to click on. Last image is mouse hovering over top left button, right? So you could add some fade-In animations to get from 1st state to 2nd...

      @Hari-Seldon said in How to create an animated button widget of complex shape?:

      3 different states and transition animations

      Just 3? Or should it be possible that every button on the outside is growing and turning red? Where should the click happen? On each part or just one button?


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

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

        @Pl45m4 Thank you for the answer. So far I was struggling to find a sensible way to implement these weird shapes and make the grow/shrink animations. After reading your answer Ill probably try the 5 buttons and from there, figure out how to make it look good.

        Just 3? Or should it be possible that every button on the outside is growing and turning red?

        Yeah, you are right, its more than 3 states. I actually meant 3 categories of states: inactive, focused and selecting one of the options (including the center one).

        Where should the click happen? On each part or just one button?

        Right now only the design and the states are set. I'll probably determine which event triggers which state transition by trying out what feels natural (using keyboard and mouse). My initial thought was to use hover to display all options, pressing and moving the mouse will change the selection and releasing confirms it but I might also try keyboard inputs.

        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