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. How to add text in QCalendarWidget ?
QtWS25 Last Chance

How to add text in QCalendarWidget ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 820 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1

    alt text

    https://github.com/sonichy

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Inherit from QCalendarWidget and reimplement paintCell function.
      void MyCalendar::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
      {
      qDebug() << Q_FUNC_INFO << endl;
      QCalendarWidget::paintCell(painter,rect,date);
      if(date==QDate::currentDate()){
      QFont font;
      font.setPixelSize(10);
      font.setBold(true);
      font.setItalic(true);
      painter->setFont(font);
      painter->drawText(rect.x()+10,rect.y()+33,"FIFA");
      }
      }

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      3

      • Login

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