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. "Loading" effect with border's pushbutton
QtWS25 Last Chance

"Loading" effect with border's pushbutton

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 1.8k 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.
  • BlackMambaB Offline
    BlackMambaB Offline
    BlackMamba
    wrote on last edited by
    #1

    Hello,

    I have a rounded QPushButton with border.
    I would like this border to be dual color depending on a value to achieve a loading effect.
    For example value 0, all the border is white, nothing is loaded; value 180, the left border is red, the right border is white, half the content has been loaded, 360 (max value) the border is completely red, everything is loaded.

    Do you have any idea how to achieve that?

    Cheers,

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clochydd
      wrote on last edited by
      #2

      Have you tried to use pushButton.styleSheet

      1 Reply Last reply
      0
      • BlackMambaB Offline
        BlackMambaB Offline
        BlackMamba
        wrote on last edited by
        #3

        yes of course but it just gives me a border.
        Then I need to customize it, I tried with gradient to have 2 colors but it gives strange results when the button is rounded, the gradiant is not calculated correctly :(

        1 Reply Last reply
        0
        • C Offline
          C Offline
          clochydd
          wrote on last edited by
          #4

          BlackMamba:
          I made a few tests with "border-top-color, border-right-width"
          etc. but could not find an attractive working solution - especially for rounded borders. I think you should consider to use bitmaps to meet your target.

          1 Reply Last reply
          0
          • BlackMambaB Offline
            BlackMambaB Offline
            BlackMamba
            wrote on last edited by
            #5

            Thanks for your help ! How would you start to achieve this with bitmaps?

            1 Reply Last reply
            0
            • C Offline
              C Offline
              clochydd
              wrote on last edited by
              #6

              I haven't worked with the .border-image yet, but some information is provided by the Qt Style Sheets Reference and a detailled description is here: "CSS3 Draft Spec":http://www.w3.org/TR/css3-background/#border-image-process

              1 Reply Last reply
              0
              • BlackMambaB Offline
                BlackMambaB Offline
                BlackMamba
                wrote on last edited by
                #7

                I will have a look at it, thank you very much !

                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