[Kde-pim] KTimeChooser time editing widget

Michael Leupold lemma at confuego.org
Sun Aug 23 13:51:12 BST 2009


Ingo Klöcker wrote:
> On Saturday 22 August 2009, Michael Leupold wrote:
>> Thomas McGuire wrote:
>> > On Thursday 13 August 2009 01:21:01 you wrote:
>> >> a while ago I took up Allen's request to make KPIM::KTimeEdit
>> >> ready for kdelibs. I named the new one KTimeChooser as it seemed
>> >> more appropriate. The current outcome can be found here and needs
>> >> a current trunk to compile (r1006747, one week ago):
>> >> http://websvn.kde.org/trunk/playground/libs/ui/ktimewidgets
>> >>
>> >> Please check if you're happy with it.
>> >
>> > I had a quick look at the headers only:
>> >
>> > - KTimeChooser should inherit KComboBox, not QComboBox
>>
>> I disagree on that. The only things KComboBox provides seem to be
>> text rotation and text completion - both of which we don't want.
> 
> What if in the future something is added to KComboBox that KTimeChooser
> should have as well? Please inherit from KComboBox to be prepared for
> this future.

I agree with your point of view. I just tried but KComboBox is a pretty 
quirky so the widget needs a lot of workarounds (and maybe more maintenance) 
if I do it.

For example KComboBox uses a KLineEdit instead of a QLineEdit. That's not 
bad at all, but it also tries to keep it a KLineEdit on every possible 
occasion. That leads to:
- the association with the validator being lost quite often (as the line 
edit associated with it gets deleted on several occasions
- having to check wether the "clear" button in the line edit is properly 
disabled

And some other things I haven't yet figured out how to fix. I'd prefer a 
fixed KComboBox but I'm not sure this is actually possible because it's 
overwriting some non-virtuals of QComboBox.

So while inheriting from QComboBox will make the widget miss new cool 
features KComboBox has, it almost seems less maintenance work to just port 
any new feature from KComboBox to KTimeChooser instead of keeping it working 
with KComboBox.

Inheriting from QWidget and delegating to a KComboBox might work though. 
I'll have to investigate that.

Regards,
Michael

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list