[Development] std::chrono getters in our API

Matthew Woehlke mwoehlke.floss at gmail.com
Fri Jun 10 22:12:10 CEST 2016

On 2016-06-10 13:53, Thiago Macieira wrote:
> I've added a set of std::chrono API to QTimer[1] and QDeadlineTimer[2] and 
> we're hitting a snag on what to name the getters. The setters are fine because 
> they're just overloads:
> 	timer.setInterval(3);		// Qt; milliseconds
> 	timer.setInterval(3ms);
> 	deadline.setRemainingTime(3600000); 	// milliseconds
> 	deadline.setRemainingTime(1h);
> 	deadline.setDeadline(QDeadlineTimer::current().deadline() + 3600000);
> 	deadline.setDeadline(std::chrono::steady_clock::now() + 1h);
> The problem are the getters: what do we call them?

Qt6-only option... return a QTimeInterval or some such with (implicit)
conversion operators.

I expect there are issues with that, but feels worth mentioning at least
for the sake of discussion.


More information about the Development mailing list