Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7879107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:49:45+00:00 2026-06-03T03:49:45+00:00

import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI()

  • 0
import sys
from PyQt4 import QtGui, QtCore

class Example(QtGui.QWidget):

    def __init__(self):
         super(Example, self).__init__()

         self.initUI()

    def initUI(self):      

        cal = QtGui.QCalendarWidget(self)
        cal.setGridVisible(True)
        cal.move(20, 20)
        cal.clicked[QtCore.QDate].connect(self.showDate)

        self.lbl = QtGui.QLabel(self)
        date = cal.selectedDate()
        self.lbl.setText(date.toString())
        self.lbl.move(130, 260)

        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle('Calendar')
        self.show()

   def showDate(self, date):     
        self.lbl.setText(date.toString())

def main():

    app = QtGui.QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())


if __name__ == '__main__':
    main()

this code generates a calender widget with the date showing, I need to be able to attach so called appointments to there relevant date via user input and then show the user that there is an appointment attached to that date i.e the date turns red

it would also be handy for me to have all the appointments in a list (or text file) so that a user can view them all at once should they choose to

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:49:46+00:00Added an answer on June 3, 2026 at 3:49 am

    the QCalendarWidget is intended as a date selector, so it’s not really made for what you try to do.
    If you only want to render certain cells differently, then you cann create your on class derived from QCalendarWidget and override it’s paintCell() method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the code below: #!/usr/bin/env python from PyQt4 import QtCore, QtGui import os,sys class
I have the following code: #!/usr/bin/env python import sys from PyQt4 import QtGui, QtCore
import sys from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtWebKit import QWebView
I'm trying to translate code from this thread in python: import sys from PyQt4.QtCore
I have this sample of code: import sys import time from PyQt4.QtGui import *
for this code: import sys import gevent from gevent import monkey monkey.patch_all() import requests
import sys sys.path.append('/home/myuser/svn-repos/myproject') from myproject.settings import * But, it says module not found when
The python implementation import sys def move(src, dst, tmp, num): if num == 1:
import sys, os X = os.system(ipconfig) print X 0 I know its simple, I'm
Server import socket import sys s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) host= 'VAC01.VACLab.com' port=int(2000) s.bind((host,port)) s.listen(1) conn,addr =s.accept() data=s.recv(100000)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.