Qt:Документация 4.3.2/qtime-qt3

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] Qt 3 Support Members for QTime

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.



[править] Статические открытые члены


[править] Описание функций-членов

[править]
QTime QTime::currentTime ( Qt::TimeSpec specification ) [static]

This is an overloaded member function, provided for convenience.

Returns the current time for the given specification.

To replace uses of this function where the specification is Qt::LocalTime, use the currentDate() overload that takes no parameters instead; otherwise, use QDateTime::currentDateTime() and convert the result to a UTC measurement.

For example, if you have code like

 QTime localTime = QTime::currentTime(Qt::LocalTime);
 QTime utcTime = QTime::currentTime(Qt::UTC);

you can rewrite it as

 QTime localTime = QTime::currentTime();
 QTime utcTime = QTimeTime::currentDateTime().toUTC().time();

See also QDateTime::toUTC().


Copyright © 2007 Trolltech Trademarks
Qt 4.3.2