PY_Skywalker
28th October 2016, 16:00
Hello All
I am trying to "Synchronise" the QCalendarWidget and QDateEdit widgets. I have managed to synchonise other widgets like sliders and tool bars by using the following statement self.ui.horizontalScrollBar.valueChanged.connect(s elf.scrollhorizontal)
I have managed to use signals and slots to get the QDateEdit widget updated when selecting the date in QCalendarWidget as per the following
QtCore.QObject.connect(self.ui.calendarWidget, QtCore.SIGNAL('selectionChanged()'), self.dispdate)
def dispdate(self):
self.ui.dateEdit.setDate(self.ui.calendarWidget.se lectedDate())
I do not seem to do the reverse i.e. wire up the QCalendarWidget so that when I change the QDateEdit value the QCalendarWidget gets updated
I have tried the following
QtCore.QObject.connect((self.ui.dateEdit), QtCore.SIGNAL('editingFinished()'),self.calwupd)
def calwupd(self):
self.ui.calendarWidget.setSelectedDate(self.ui.dat eEdit.Date())
Environment Details:
Windows 8.1
Python 3.4
PyQt 4
Your help would be much appreciated.
Many Thanks
James
I am trying to "Synchronise" the QCalendarWidget and QDateEdit widgets. I have managed to synchonise other widgets like sliders and tool bars by using the following statement self.ui.horizontalScrollBar.valueChanged.connect(s elf.scrollhorizontal)
I have managed to use signals and slots to get the QDateEdit widget updated when selecting the date in QCalendarWidget as per the following
QtCore.QObject.connect(self.ui.calendarWidget, QtCore.SIGNAL('selectionChanged()'), self.dispdate)
def dispdate(self):
self.ui.dateEdit.setDate(self.ui.calendarWidget.se lectedDate())
I do not seem to do the reverse i.e. wire up the QCalendarWidget so that when I change the QDateEdit value the QCalendarWidget gets updated
I have tried the following
QtCore.QObject.connect((self.ui.dateEdit), QtCore.SIGNAL('editingFinished()'),self.calwupd)
def calwupd(self):
self.ui.calendarWidget.setSelectedDate(self.ui.dat eEdit.Date())
Environment Details:
Windows 8.1
Python 3.4
PyQt 4
Your help would be much appreciated.
Many Thanks
James