Sth hard to explain ...



  • Hi all

    I have strange issue to solve...

    I have many buttons on a Qdialog... The buttons are checkable and every button have this kind of stylesheet..

    #thebutton {
    background-color: transparent;
    border-image: url(:/images/buton_off.png);
    background: none;
    border: none;
    background-repeat: none;
    }
    #thebutton::checked
    {
    border-image: url(:/images/buton_on.png);
    }
    #thebutton::unchecked
    {
    border-image: url(:/images/buton_off.png);
    }
    

    Every button has an id becouse I use QsignalMapper to collect them so I need the buttons to be clickable but when I press on them they change the state to checked..
    ok
    I don't want the button get the checked state from the click.. I want to give the checked state from QDataWidgetMapper

    How can I do that..

    Any way to do ?


  • Qt Champions 2017

    Hi
    You could remove the checkable flag so click dont change it and then
    set the border-image: to _on/_off yourself at a later time and simply not use
    #thebutton::checked/#thebutton::unchecked but rather just
    change the default image in the #thebutton section.



  • Thanks @mrjj

    I solved it by using :flat flag :)


Log in to reply
 

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