Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5 QDateEdit Stylesheet button
Forum Updated to NodeBB v4.3 + New Features

Qt5 QDateEdit Stylesheet button

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 3.0k Views 1 Watching
  • 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
    ArcNexus
    wrote on last edited by
    #1

    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.

    When we are one, we win

    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