[Qt-interest] Duration editor similar to QTimeEdit/QTime
Robert Wood
robert.wood at apostrophe.co.uk
Tue Feb 9 16:12:33 CET 2010
George Ryan wrote:
> Hello,
>
> I would like to have a widget that operates like the QTimeEdit class,
> but does not limit the hours to 0-23. It is for specifying a duration
> offset, such a 34hours, 13 minutes 12 seconds.
>
> Since the QTimeEdit class deals with QTime, which is restricted to clock
> time, I didn't immediately see any way of extending or modifying that class.
>
> Does anyone have any suggestions on the best way to do this?
>
> Thanks!
> George
I might well be talking out of my backside or completely misunderstood,
so sorry if that is the case.
Could you not set up a QTimer (that's QTimer, not QTime) as a single
shot and then put in the previously calculated millisecond offset to
which you need to count? It looks like the interval takes an int, which
will, I assume be at least a 32 bit value. If my feeble mind has worked
it our correctly, that would be a maximum interval of 49 days!
Cheers,
Rob
More information about the Qt-interest-old
mailing list