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. Problems trying to costumize a QCalendarWidget
Forum Updated to NodeBB v4.3 + New Features

Problems trying to costumize a QCalendarWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.4k Views
  • 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.
  • P Offline
    P Offline
    Piontk
    wrote on last edited by Piontk
    #1

    I'm trying to apply some stylesheets to my QCalendarWidget, and I already made some changes. Here is my code at the moment:

    QCalendarWidget QWidget{
    
    background-color:magenta;
    
    color: green;
    
    }
    
    QCalendarWidget QToolButton{
    
    background-color:black;
    
    color: green;
    
    icon-size: 30px;
    
    }
    
    QCalendarWidget QMenu{
    
    background-color:magenta;
    
    color: green;
    
    }
    
    QCalendarWidget QAbstractItemView:enabled{
    
    background-color: yellow;
    
    color: black;
    
    }
    
    QCalendarWidget QAbstractItemView:disabled{
    
    background-color: yellow;
    
    color: white;
    
    }
    
    QCalendarWidget QMenu{
    
    background-color: rgb(255, 46, 221);
    
    }
    
    QCalendarWidget QSpinBox{
    
    background-color: black;
    
    }
    

    The result is: https://imgur.com/a/3Lflmmx

    The problem is that I can't find how I customize the green arrows, the number of the week, and the days of the week. Any suggestions?

    The documentation of QCalendarWidget doesn't mention how it can be costumized.

    JonBJ 1 Reply Last reply
    0
    • P Piontk

      I'm trying to apply some stylesheets to my QCalendarWidget, and I already made some changes. Here is my code at the moment:

      QCalendarWidget QWidget{
      
      background-color:magenta;
      
      color: green;
      
      }
      
      QCalendarWidget QToolButton{
      
      background-color:black;
      
      color: green;
      
      icon-size: 30px;
      
      }
      
      QCalendarWidget QMenu{
      
      background-color:magenta;
      
      color: green;
      
      }
      
      QCalendarWidget QAbstractItemView:enabled{
      
      background-color: yellow;
      
      color: black;
      
      }
      
      QCalendarWidget QAbstractItemView:disabled{
      
      background-color: yellow;
      
      color: white;
      
      }
      
      QCalendarWidget QMenu{
      
      background-color: rgb(255, 46, 221);
      
      }
      
      QCalendarWidget QSpinBox{
      
      background-color: black;
      
      }
      

      The result is: https://imgur.com/a/3Lflmmx

      The problem is that I can't find how I customize the green arrows, the number of the week, and the days of the week. Any suggestions?

      The documentation of QCalendarWidget doesn't mention how it can be costumized.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Piontk
      Unless anyone replies better:

      Have a look at https://forum.qt.io/topic/75661/stylesheet-to-calender-popup, there seem to be quite a few more styles being used there to give you ideas? There is also https://stackoverflow.com/questions/14668344/qt-qcalendarwidget-qss-styling for some further ideas.

      You can Google for, say, qcalendarwidget stylesheet, there are quite a few posts out there which may help you. Or you could look through the source code like others have done to get something specific to your desires.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved