Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Customizing QDateEdit Styling Sheet



  • How can i get the appearance of QDateEdit as shown on the image?
    1.png

    I tried to change the stylesheet, but I do not know how to achieve a frame around the numbers. Version qt4.7.8.

         QDateTimeEdit {
         padding-top: 20px; 
         padding-bottom: 20px; 
    
         border-image: url("/home/image/next.png");
         border-width: 0px;
    
         background-clip: content;
     }
    
     QDateTimeEdit::up-button {
         subcontrol-origin:   border;
         subcontrol-position: top center left center;
         top: 15px; 
         left: 20px;
         width: 16px;
         height:16px;
         border-image: url("/home/image/next_.png");
     }
    
     QDateTimeEdit::down-button {
         subcontrol-origin:  border;
         subcontrol-position: bottom center;
         width: 16px;
         height:16px;
     }
    

Log in to reply