[Development] QTime microsecond support

Dustin Mitchell dmmitche at gmail.com
Thu Oct 15 00:21:10 CEST 2015


I see what you mean about a lot of things assuming mds within QTime
contains milliseconds. Would changing QTime to support microseconds be too
much of an invasive change to include before Qt 6?

Dustin

On Wed, Oct 14, 2015 at 3:14 PM, Thiago Macieira <thiago.macieira at intel.com>
wrote:

> On Wednesday 14 October 2015 23:10:56 Olivier Goffart wrote:
> > On Wednesday 14. October 2015 13:53:03 Thiago Macieira wrote:
> > > On Wednesday 14 October 2015 14:22:13 Dustin Mitchell wrote:
> > > > Hello,
> > > >
> > > > Are there plans to support microseconds in the QTime class? I need to
> > > > parse
> > > > timestamps from a text file and it has microsecond resolution. If
> not,
> > > > I'd
> > > > be willing to implement this feature.
> > >
> > > You'll have to wait for Qt 6. It's impossible to add it now.
> >
> > Not impossible,  just a bit tricky.
>
> It really is impossible. QTime has one member (an int), no d pointer and it
> has a lot of inline members that access that integer assuming it is a
> millisecond value.
>
> > One could add a Qt::TimerType which is of type
> "MicroSecondResolutionTimer"
> > which would change the meaning of the interval to be in microsecond.
> >
> > Then you would need a protected
> > QAbstractEventDispatcher::setSupportMicroSecondTimer  that the capable
> > dispatcher would set to true.  Qt would have to convert to milisecond if
> the
> > event dispatcher does not support this.
>
> He said QTime, not QTimer.
>
> For microsecond support in QTimer, I'd like to see <chrono> in use. With Qt
> 5.7 and QT_HAS_INCLUDE(<chrono>), that should be possible, since any and
> all
> use of std::chrono is inline anyway.
>
> As for the event dispatcher, please make sure that any solution you develop
> works with user-provided dispatchers that do not know about microsecond
> resolution. This may be an impossible task before Qt 6.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20151014/8238ddbf/attachment.html>


More information about the Development mailing list