Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [solved] animate/or 'clicked effect' of buttons in the designer
QtWS25 Last Chance

[solved] animate/or 'clicked effect' of buttons in the designer

Scheduled Pinned Locked Moved Mobile and Embedded
9 Posts 2 Posters 16.1k 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.
  • A Offline
    A Offline
    alfah
    wrote on last edited by
    #1

    could anybody help me out on this

    I've created a form using Qt designer and have used the default push buttons. But somehow these buttons do not highlight or show any response when clicked even though it proceeds to the next page.
    Ive customized the buttons using Edit Style Sheet

    @color: rgb(0, 0, 0);
    border-style: outset;
    border-width: 0px;
    border-radius: 10px;
    border-color: beige;
    font: bold 20px;
    min-width: 8em;
    padding: 0px@

    should i enable any property??
    There are properties such as 'checkable' or the 'flat', 'default'. checking these do not give me the desired result either.

    Thank you

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Try to use a border width thicker than 0px.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alfah
        wrote on last edited by
        #3

        Eddy,

        I've tried that. It does give a border but the click effect is not there.
        So the user might click more number of times thinking its not been clicked.

        Thank you

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          "Have a look at the QPushButton style sheet example":http://doc.qt.nokia.com/4.7/stylesheet-examples.html#customizing-a-qpushbutton-using-the-box-model

          You have to define the :pressed state also otherwise the button always acts the same pressed or not.

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alfah
            wrote on last edited by
            #5

            :) thanks eddy

            Jus one more thing, im using the edit style sheets.

            so
            jus writing

            @:pressed{color: rgb(0, 0, 0);
            border-style: outset;
            border-width: 2px;
            border-radius: 10px;
            border-color: beige;
            font: bold 20px;
            min-width: 8em;
            padding: 0px}@

            or is it
            @settingBut:pressed{color: rgb(0, 0, 0);
            border-style: outset;
            border-width: 2px;
            border-radius: 10px;
            border-color: beige;
            font: bold 20px;
            min-width: 8em;
            padding: 0px}@

            cuz it says invalid stylesheets!.

            P.S settingBut is my button obj

            thankyou,

            1 Reply Last reply
            0
            • A Offline
              A Offline
              alfah
              wrote on last edited by
              #6

              never mind the above post.

              i got it !! :)

              thank you ,

              1 Reply Last reply
              0
              • A Offline
                A Offline
                alfah
                wrote on last edited by
                #7

                Thank you,

                this is the code is incase somebody needs it.

                @QPushButton#reminderBut { color: rgb(0, 0, 0);

                 border-width: 1px;
                 border-radius: 10px;
                 font: bold 20px;
                 min-width: 8em;
                 padding: 5px;
                

                }

                QPushButton#reminderBut:pressed
                {
                border-style:solid;
                border-width:2px;
                }@

                1 Reply Last reply
                0
                • EddyE Offline
                  EddyE Offline
                  Eddy
                  wrote on last edited by
                  #8

                  Good job! And thanks for sharing the solution.

                  Could you please add [Solved] in the beginning of your title. This is a habit we have, to make it easier for everyone to find solutions which are solved and for everyone, chasing for problems, they don't have to go there anymore ;)

                  Qt Certified Specialist
                  www.edalsolutions.be

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    alfah
                    wrote on last edited by
                    #9

                    :) ive done that Eddy :)

                    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