KTimeChooser moved to kdereview

Michael Leupold lemma at confuego.org
Tue Aug 25 13:08:33 BST 2009


I just moved a new widget for editing times to kdereview: KTimeChooser.

It is a reworked version of KPIM::KTimeEdit, basically a time editing widget 
with a combobox containing a list of predefined times (with configurable 
interval between them). It is meant to be used in places where the user is 
more likely to choose a time using the combobox than entering it manually 
(eg. when scheduling meetings which usually begin at :00, :15, :30 or :45).

Other features:
- Times can be entered and displayed using the configured time format
- Additionally times can be entered in military (eg. 1830) or plain 24h 
format (eg. 18:30). Those times will be recognized and "localized" using 
KTimeValidator (private API).

Minor issues/things to talk about:
- I'm using a model to provide the list of times to choose from. It seems 
there's a Qt bug so the widget will not resize properly if the model is 
reset. You can witness the bug when unchecking "include seconds" in the 
example app - I filed a task tracker item with the trolls.
- Keyboard navigation is currently handled the same way KPIM::KTimeEdit does 
it: Up/Down will add/subtract a minute, PgUp/PgDown will add/subtract an 
hour. Alternatively keyboard navigation could be done the same way QTimeEdit 
does it (Up/Down adds/subtracts 1 to the field the cursor is hovering, 
PgUp/PgDown adds/subtracts a bigger value to the field the cursor is 

You can find the widget at 
http://websvn.kde.org/trunk/kdereview/ktimechooser. An example application 
and unit-tests are provided. krazy2 reports no issues, valgrind doesn't find 
anything related to the new classes either.

Thanks and regards,

More information about the kde-core-devel mailing list