Style dateedit button



  • Can someone provide an example of how to set the icon of the dateedit downbutton? The stylesheet docs say 'see spinbox', and that suggests things like this (but they don't work for me):

    @ QDateEdit::down-button {
    subcontrol-origin: border;
    subcontrol-position: bottom right; /* position at bottom right corner */

     width: 16px;
     border-image: url(:/images/spindown.png) 1;
     border-width: 1px;
     border-top-width: 0;
    

    }
    @



  • This worked for me, see if it is what you are looking.

    @
    QDateEdit {
    background-color: rgb(255, 255, 255);
    }
    QDateEdit::down-arrow {
    image: url(:/down-arrow.png);
    border: 1px solid #000000;
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    stop: 0 #dedede, stop: 0.5 #434343,
    stop: 0.51 #000000, stop: 1 #656a6d);
    }
    @

    [EDIT: code formatting, please wrap in @-tags, Volker]


Log in to reply
 

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