Qt World Summit: Register Today!

Qt5 QDateEdit Stylesheet button

  • Hi All,

    How I can change button Image for QDateEdit with calendarPopup enabled = true in Qt5 application?.

    I have used the new style called fusion and I have a qss file with stylesheet parameters.

    I have this code in my qss stylesheet file, It works fine for QComboBox and other widgets but it not work for QDateEdit:

    @QDateEdit[calendarPopup="true"]::up-button {
    subcontrol-origin: border;
    subcontrol-position: top right;

    width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
    border-image: url(Icons:/images/spinup.png) 1;
    border-width: 1px;


    QDateEdit[calendarPopup="true"]::up-button:hover {
    border-image: url(Icons:/images/spinup_hover.png) 1;

    QDateEdit[calendarPopup="true"]::up-button:pressed {
    border-image: url(Icons:/images/spinup_pressed.png) 1;

    QDateEdit[calendarPopup="true"]::down-button {
    subcontrol-origin: border;
    subcontrol-position: bottom right;

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


    Someone know about this?

    Lots of thanks.

Log in to reply