Location for freeware Qt extensions Widgets
-
Are there any good locations to find Qt WIdgets that supplement what Qt provides? I'm looking for a control similar to QTimeEdit but for durations (Exposure time) which can run from less that 1/1000s (e.g. 1/4000s) to many hours.
Ideally if the exposure is less than 1s it should edit it as rational fractions (e.g. 1/500, 1/125 1/4000), but failing that it should support (say) microseconds.
For exposures >1s then I think that only 3 decimals are needed.
Yes of course I could start from nothing and write my own, but if there's something out there that will work why would I wish to?
Thanks
David -
Hi,
https://inqlude.org/ might be a starting point however, your use case seems highly specific. Maybe some photograph related application might contain something.
-
@Perdrix
You asked this a couple of weeks ago. Do you not think it is highly unlikely anyone would have written a Qt widget anywhere near as "specific" as this? I do not mean to be provocative, but as I said there you could have written some edit widget which has all the right number of spinners/digits for just what you want in, like, 10 minutes? -
@JonB Ten minutes really - I'm clearly missing something - how to handle the increment of the left neighbour when right neighbour wraps? Fill all the fields and validate them when the user clicks away from the control, or moves to the next section etc etc..
Sure I could probably do something trivial that doesn't really work in that sort of time frame, though I think longer than ten minutes. It needs to be pretty user proof.
If it were that easy the QDateTimeEdit code would not be the size that it is.
D.
-
@Perdrix
As I suggested elsewhere, I believe you just want 4 spinboxes: hours, minutes, seconds, milliseconds. Or something close.QSpinBox
es have a minimum and a maximum, so that is your validation done. I am unconvinced that you want "wrap" from one spinbox to the next (doesQDateTimeEdit
even do that??), though it can be added.As I also commented elsewhere, a
QDateTimeEdit
( orQDateTime
type) is not the right type for your requirement. (Handling date entry/exit is the largest part of "the QDateTimeEdit code would not be the size that it is.".) You want a duration. These two do not deliver that, they deliver a "point in time". Your desired return type might be aQTime
, but it might well be easier for your case to return some (long) integer. If you did that you could easily handle you expressed desire elsewhere (IIRC?) for potentially supporting nanoseconds. Note thatQElapsedTimer
, the one Qt class which supports a time duration, uses aqint64
as the fundamental data type, not a time-type, and also supports nanoseconds if wanted. You really want aQElapsedTimerEdit
.Let us know if you find a Qt widget which does just what you want instead of writing it yourself.