On sexta-feira, 10 de junho de 2016 16:12:10 PDT Matthew Woehlke wrote:
> 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.

QTimeInterval helps for std::chrono::duration, but not for the other use in 
QDeadlineTimer: deadline() returns the equivalent of a 
std::chrono::time_point.

QDeadlineTimer *is* the equivalent of a std::chrono::time_point.

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

So, you're suggesting not doing anything now, leave std::chrono support out in 
Qt 5, and do it only for Qt 6?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to