You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
13 years ago
|
from qt import TQFrame, TQStringList, TQVBoxLayout, SIGNAL, TQLabel, TQSizePolicy, TQt
|
||
|
from qttable import TQTable
|
||
13 years ago
|
from tdeui import KTextEdit, KDatePicker, KDateWidget
|
||
13 years ago
|
|
||
|
|
||
|
labelText = 'KDatePicker'
|
||
|
iconName = 'date'
|
||
|
helpText = """A date selection widget.
|
||
|
|
||
|
Provides a widget for calendar date input.
|
||
|
|
||
|
Different from the previous versions, it now emits two types of
|
||
|
signals, either dateSelected() or dateEntered() (see documentation for
|
||
|
both signals).
|
||
|
|
||
|
A line edit has been added in the newer versions to allow the user to
|
||
|
select a date directly by entering numbers like 19990101 or 990101.
|
||
|
"""
|
||
|
|
||
13 years ago
|
class MainFrame(TQFrame):
|
||
13 years ago
|
def __init__(self, parent=None):
|
||
13 years ago
|
TQFrame.__init__(self, parent)
|
||
13 years ago
|
self.help = KTextEdit(helpText, '', self)
|
||
|
self.dateDisplay = KDateWidget(self)
|
||
|
|
||
13 years ago
|
self.dateDisplay.setSizePolicy(TQSizePolicy(TQSizePolicy.Maximum,
|
||
|
TQSizePolicy.Maximum))
|
||
13 years ago
|
|
||
|
self.datePicker = KDatePicker(self)
|
||
|
|
||
13 years ago
|
layout = TQVBoxLayout(self)
|
||
13 years ago
|
layout.addWidget(self.help, 1)
|
||
13 years ago
|
layout.addWidget(self.datePicker, 0, TQt.AlignHCenter)
|
||
13 years ago
|
layout.addStretch(1)
|
||
|
|
||
13 years ago
|
self.other = TQLabel('Selected Date:', self)
|
||
13 years ago
|
layout.addWidget(self.other, 0)
|
||
|
layout.addWidget(self.dateDisplay, 2)
|
||
|
|
||
13 years ago
|
self.connect(self.datePicker, SIGNAL('dateChanged(TQDate)'),
|
||
13 years ago
|
self.dateDisplay.setDate)
|
||
|
|