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



  • 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


  • Moderators

    Try to use a border width thicker than 0px.



  • 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


  • Moderators

    "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.



  • :) 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,



  • never mind the above post.

    i got it !! :)

    thank you ,



  • 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;
    }@


  • Moderators

    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 ;)



  • :) ive done that Eddy :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.