QDeadlineTimer Class
QDeadlineTimerクラスは、未来の期限をマークします。詳細...
ヘッダー | #include <QDeadlineTimer> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
このクラスは強く比較可能である。
注意:このクラスの関数はすべてリエントラントです。
パブリック型
enum class | ForeverConstant { Forever } |
パブリック関数
QDeadlineTimer() | |
QDeadlineTimer(Qt::TimerType timerType) | |
QDeadlineTimer(QDeadlineTimer::ForeverConstant, Qt::TimerType timerType = Qt::CoarseTimer) | |
QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) | |
QDeadlineTimer(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type = Qt::CoarseTimer) | |
QDeadlineTimer(std::chrono::time_point<Clock, Duration> deadline, Qt::TimerType type = Qt::CoarseTimer) | |
qint64 | deadline() const |
qint64 | deadlineNSecs() const |
bool | hasExpired() const |
bool | isForever() const |
qint64 | remainingTime() const |
std::chrono::nanoseconds | remainingTimeAsDuration() const |
qint64 | remainingTimeNSecs() const |
void | setDeadline(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer) |
void | setDeadline(std::chrono::time_point<Clock, Duration> deadline, Qt::TimerType type = Qt::CoarseTimer) |
void | setPreciseDeadline(qint64 secs, qint64 nsecs = 0, Qt::TimerType timerType = Qt::CoarseTimer) |
void | setPreciseRemainingTime(qint64 secs, qint64 nsecs = 0, Qt::TimerType timerType = Qt::CoarseTimer) |
void | setRemainingTime(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer) |
void | setRemainingTime(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type = Qt::CoarseTimer) |
void | setTimerType(Qt::TimerType timerType) |
void | swap(QDeadlineTimer &other) |
Qt::TimerType | timerType() const |
QDeadlineTimer & | operator+=(qint64 msecs) |
QDeadlineTimer & | operator-=(qint64 msecs) |
QDeadlineTimer & | operator=(std::chrono::duration<Rep, Period> remaining) |
QDeadlineTimer & | operator=(std::chrono::time_point<Clock, Duration> deadline_) |
静的パブリック・メンバ
QDeadlineTimer | addNSecs(QDeadlineTimer dt, qint64 nsecs) |
QDeadlineTimer | current(Qt::TimerType timerType = Qt::CoarseTimer) |
関連する非メンバー
bool | operator!=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs) |
QDeadlineTimer | operator+(QDeadlineTimer dt, qint64 msecs) |
QDeadlineTimer | operator+(qint64 msecs, QDeadlineTimer dt) |
QDeadlineTimer | operator-(QDeadlineTimer dt, qint64 msecs) |
bool | operator<(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs) |
bool | operator<=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs) |
bool | operator==(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs) |
bool | operator>(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs) |
bool | operator>=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs) |
詳細説明
QDeadlineTimer クラスは通常、将来の期限を計算し、期限が切れたかどうかを検証するために使用されます。QDeadlineTimer は、期限切れのない("forever")期限にも使用できます。これは、QElapsedTimer::start() が呼び出されてからどれだけの時間が経過したかを計算するQElapsedTimer と対を成すものです。
QDeadlineTimerは、QElapsedTimer::hasExpired ()と比べてより便利なAPIを提供します。
このクラスの典型的な使用例は、問題の操作が開始される前に QDeadlineTimer を作成し、remainingTime() またはhasExpired() を使用して、操作を続行するかどうかを判断することです。QDeadlineTimerオブジェクトは、この操作を実行するために呼び出される関数に渡すことができます。
void executeOperation(int msecs) { QDeadlineTimer deadline(msecs); do { if (readFromDevice(deadline.remainingTime())) break; waitForReadyRead(deadline); } while (!deadline.hasExpired()); }
多くのQDeadlineTimer関数はタイムアウト値を扱いますが、その単位はすべてミリ秒です。waitFor
などの Qt 関数と同じように、2 つの特別な値があります:
- 0: 残り時間なし。
- -1: 残り時間が無限で、タイマーが切れることはない。
時計の参照
QDeadlineTimerはQElapsedTimer (QElapsedTimer::clockType ()とQElapsedTimer::isMonotonic ()を参照)と同じクロックを使用します。
タイマーの種類
QTimer やQChronoTimer のように、QDeadlineTimer はタイマーの粗さのレベルを選択することができます。タイマーを設定したり変更したりする関数にQt::PreciseTimer を渡すことで、正確なタイミングを選択できます。また、Qt::CoarseTimer を渡すことで、粗いタイミングを選択できます。Qt::VeryCoarseTimer は、現在のところQt::CoarseTimer と同じように解釈されます。
OSが粗いタイマー機能をサポートしていない場合、QDeadlineTimerはQt::PreciseTimer 。
QDeadlineTimerのデフォルトはQt::CoarseTimer 。これは、粗いタイミングをサポートしているオペレーティング・システムでは、そのクロック・ソースへのタイミング呼び出しがはるかに効率的であることが多いためです。粗さのレベルはオペレーティング・システムによって異なりますが、数ミリ秒のオーダーであるべきです。
std::chrono
互換性
QDeadlineTimer は、C++11 のstd::chrono
API と互換性があり、std::chrono::duration
とstd::chrono::time_point
の両方のオブジェクトから構築したり、それらのオブジェクトと比較したりできます。さらに、C++14 の時間リテラルとも完全に互換性があり、次のようにコードを記述できます:
using namespace std::chrono; using namespace std::chrono_literals; QDeadlineTimer deadline(30s); device->waitForReadyRead(deadline); if (deadline.remainingTime<nanoseconds>() > 300ms) cleanup();
上の例でわかるように、QDeadlineTimerには、remainingTime ()とdeadline ()のテンプレート版があり、std::chrono
オブジェクトを返すために使用できます。
QDeadlineTimerは、自身の内部クロック・ソースから、time_point
オブジェクトが使用するクロック・ソースに変換する必要があるため、time_point
との比較は、duration
との比較ほど効率的ではないことに注意してください。また、この変換のために、デッドラインは正確ではないので、以下のコードは等しく比較されないことに注意してください:
using namespace std::chrono; using namespace std::chrono_literals; auto now = steady_clock::now(); QDeadlineTimer deadline(now + 1s); Q_ASSERT(deadline == now + 1s);
QTime 、QChronoTimer 、QDeadlineTimer 、Qt::TimerTypeも参照のこと 。
メンバー型ドキュメント
enum class QDeadlineTimer::ForeverConstant
定数 | 値 | 説明 |
---|---|---|
QDeadlineTimer::ForeverConstant::Forever | 0 | QDeadlineTimer 、期限切れにならないことを示すために使用される。 |
メンバー関数ドキュメント
[constexpr noexcept]
QDeadlineTimer::QDeadlineTimer()
[explicit constexpr noexcept]
QDeadlineTimer::QDeadlineTimer(Qt::TimerType timerType)
期限切れのQDeadlineTimer オブジェクトを構築する。このオブジェクトの場合、remainingTime() は 0 を返す。timerType が設定されていない場合、オブジェクトはcoarse timer type を使用する。
タイマーはすでに期限切れなので、タイマー・タイプtimerType は無視してもよい。同様に、最適化のため、この関数は現在時刻を取得しようとせず、過去の値を使用する。したがって、deadline ()は予期しない値を返す可能性があり、このオブジェクトを期限切れ時間の計算に使用することはできない。そのような機能が必要な場合は、QDeadlineTimer::current() を使用してください。
hasExpired()、remainingTime()、Qt::TimerType 、およびcurrent()も参照 。
[constexpr noexcept]
QDeadlineTimer::QDeadlineTimer(QDeadlineTimer::ForeverConstant, Qt::TimerType timerType = Qt::CoarseTimer)
ForeverConstant で作成された QDeadlineTimer オブジェクトは決して期限切れにならない。このようなオブジェクトの場合、remainingTime ()は-1、deadline ()は最大値、isForever ()はtrueを返す。
タイマー・タイプtimerType は無視してもよい。
ForeverConstant 、hasExpired()、isForever()、remainingTime()、timerType()も参照 。
[explicit noexcept]
QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer)
msecs が正の値である場合、このオブジェクトが生成された時点からmsecs msecs の有効期限を持つ QDeadlineTimer オブジェクトを構築する。msecs がゼロの場合、この QDeadlineTimer は期限切れとしてマークされ、remainingTime() はゼロを返し、deadline() は過去の不確定な時点を返します。msecs が負の場合、タイマーは期限切れにならないように設定され、remainingTime() は -1 を返し、deadline() は最大値を返します。
QDeadlineTimer オブジェクトは、指定されたタイマーtype で構築されます。
最適化のため、msecs がゼロの場合、この関数は現在時刻の取得を省略し、代わりに過去の既知の値を使用することがあります。その場合、deadline() は予期しない値を返すことがあり、このオブジェクトを期限切れ時間の計算に使用することはできません。そのような機能が必要な場合は、QDeadlineTimer::current() を使用し、それに時間を追加してください。
注意: Qt 6.6以前では、タイマーが期限切れにならない唯一の値は-1でした。
hasExpired(),isForever(),remainingTime(),setRemainingTime()も参照してください 。
template <typename Rep, typename Period> QDeadlineTimer::QDeadlineTimer(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type = Qt::CoarseTimer)
remaining の残り時間を持つ QDeadlineTimer オブジェクトを構築します。remaining がゼロまたは負の場合、この QDeadlineTimer オブジェクトは期限切れとしてマークされ、remaining がduration::max()
と等しい場合、オブジェクトは期限切れにならないように設定されます。
QDeadlineTimer オブジェクトは、指定されたタイマーtype で構築されます。
このコンストラクタは、in などの C++14 のユーザー定義時間リテラルとともに使用できます:
using namespace std::chrono_literals; QDeadlineTimer deadline(250ms);
最適化のため、remaining がゼロまたは負の場合、この関数は現在時刻の取得を省略し、代わりに過去の既知の値を使用することがあります。その場合、deadline ()は予期しない値を返し、このオブジェクトを期限切れ時間の計算に使用できないことがある。そのような機能が必要な場合は、QDeadlineTimer::current() を使用し、それに時間を追加してください。
hasExpired()、isForever()、remainingTime()、setRemainingTime()も参照 。
template <typename Clock, typename Duration = typename Clock::duration> QDeadlineTimer::QDeadlineTimer(std::chrono::time_point<Clock, Duration> deadline, Qt::TimerType type = Qt::CoarseTimer)
Clock
のクロック・ソースから Qt の内部クロック・ソース(QElapsedTimer::clockType() を参照)に変換して、deadline 時点のデッドラインを持つ QDeadlineTimer オブジェクトを構築します。
deadline が過去の場合、この QDeadlineTimer オブジェクトは期限切れに設定され、deadline がDuration::max()
と等しい場合、このオブジェクトは期限切れにならないように設定されます。
QDeadlineTimer オブジェクトは、指定されたタイマーtype で構築されます。
hasExpired(),isForever(),remainingTime(),setDeadline()も参照 。
[static noexcept]
QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs)
dt の期限からnsecs ナノ秒だけ期限を延長したQDeadlineTimer オブジェクトを返す。dt が期限切れにならないように設定されていた場合、この関数は期限切れにならないQDeadlineTimer を返す。
注意: dt が期限切れとして作成された場合、その期限は不確定であり、時間を追加しても期限切れにならないかもしれない。
[static noexcept]
QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType = Qt::CoarseTimer)
期限切れであるが、現在時刻を含むことが保証されているQDeadlineTimer を返す。この関数で生成されたオブジェクトは、deadline ()関数を使用して、タイマーの期限切れ時間の計算に参加することができる。
QDeadlineTimer オブジェクトは、指定されたtimerType で構築されます。
[noexcept]
qint64 QDeadlineTimer::deadline() const
QElapsedTimer::msecsSinceReference() と同じ、基準クロックからの相対ミリ秒単位で計算された、QDeadlineTimer オブジェクトに格納されている期限の絶対時点を返す。このQDeadlineTimer が期限切れの場合、値は過去になります。
このQDeadlineTimer が期限切れでない場合、この関数はstd::numeric_limits<qint64>::max()
を返す。
この関数は、以下の例のように、QDeadlineTimer::current ()またはQElapsedTimer::msecsSinceReference () を引くことによって、タイマーの期限切れ時間を計算するために使用することができる:
qint64 realTimeLeft = deadline.deadline(); if (realTimeLeft != (std::numeric_limits<qint64>::max)()) { realTimeLeft -= QDeadlineTimer::current().deadline(); // or: //QElapsedTimer timer; //timer.start(); //realTimeLeft -= timer.msecsSinceReference(); }
注意: 期限切れとして作成されたタイマーは、その期限として過去の不確定な時点を持つため、上記の計算が機能しない場合があります。
remainingTime ()、deadlineNSecs ()、setDeadline ()も参照 。
[noexcept]
qint64 QDeadlineTimer::deadlineNSecs() const
QElapsedTimer::msecsSinceReference() と同じ、基準クロックからの相対ナノ秒単位で計算された、QDeadlineTimer オブジェクトに格納されている期限の絶対時点を返す。このQDeadlineTimer が期限切れの場合、値は過去になります。
このQDeadlineTimer が期限切れでない場合、または期限までのナノ秒数を戻り値の型に含めることができない場合、この関数はstd::numeric_limits<qint64>::max()
を返す。
この関数は、以下の例のように、QDeadlineTimer::current ()を差し引くことで、タイマーの期限超過時間を計算するために使用することができます:
qint64 realTimeLeft = deadline.deadlineNSecs(); if (realTimeLeft != std::numeric_limits<qint64>::max()) realTimeLeft -= QDeadlineTimer::current().deadlineNSecs();
注意: 期限切れとして作成されたタイマーは、その期限として過去の不確定な時点を持つので、上記の計算は機能しないかもしれません。
remainingTime() および deadlineNSecs()も参照の こと。
[noexcept]
bool QDeadlineTimer::hasExpired() const
このQDeadlineTimer オブジェクトが期限切れの場合は true を返し、残り時間がある場合は false を返す。有効期限が切れたオブジェクトについては、remainingTime() はゼロを返し、deadline() は過去の時点を返す。
QDeadlineTimer ForeverConstant で作成されたオブジェクトの有効期限はなく、この関数は常に false を返します。
isForever() およびremainingTime()も参照 。
[constexpr noexcept]
bool QDeadlineTimer::isForever() const
このQDeadlineTimer オブジェクトが期限切れにならない場合は真を、そうでない場合は偽を返す。期限が切れないタイマーの場合、remainingTime() は常に -1 を返し、deadline() は最大値を返す。
ForeverConstant 、hasExpired()、remainingTime()も参照 。
[noexcept]
qint64 QDeadlineTimer::remainingTime() const
このQDeadlineTimer オブジェクトの残り時間をミリ秒単位で返す。タイマーがすでに期限切れになっている場合、この関数は0を返し、この関数で期限切れ時間を取得することはできません(取得するには、deadline ()を参照してください)。タイマーが期限切れにならないように設定されていた場合、この関数は -1 を返します。
この関数は、多くのQIODevice waitFor
関数や、QMutex,QWaitCondition,QSemaphore,QReadWriteLock の時間指定ロック関数など、ミリ秒のタイムアウトを取る Qt API での使用に適しています。例えば
mutex.tryLock(deadline.remainingTime());
setRemainingTime(),remainingTimeNSecs(),isForever(),hasExpired()も参照してください 。
[noexcept]
std::chrono::nanoseconds QDeadlineTimer::remainingTimeAsDuration() const
期限までの残り時間を返します。
[noexcept]
qint64 QDeadlineTimer::remainingTimeNSecs() const
このQDeadlineTimer オブジェクトの残り時間をナノ秒単位で返します。タイマーがすでに期限切れになっている場合、この関数は0を返し、この関数で期限切れ時間を取得することはできません。タイマーが期限切れにならないように設定されていた場合、この関数は -1 を返す。
remainingTime()、isForever()、hasExpired()も参照のこと 。
[noexcept]
void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer)
このQDeadlineTimer オブジェクトの期限を、基準クロックからのミリ秒単位でカウントされたmsecs 絶対時点に設定し(QElapsedTimer::msecsSinceReference()と同じ)、タイマータイプをtimerType に設定する。値が過去の場合、このQDeadlineTimer は期限切れとしてマークされる。
msecs がstd::numeric_limits<qint64>::max()
である場合、または期限が将来の表現可能な時点を超えている場合、 このQDeadlineTimer は期限切れにならないように設定される。
setPreciseDeadline()、deadline()、deadlineNSecs()、setRemainingTime()も参照のこと 。
template <typename Clock, typename Duration = typename Clock::duration> void QDeadlineTimer::setDeadline(std::chrono::time_point<Clock, Duration> deadline, Qt::TimerType type = Qt::CoarseTimer)
このQDeadlineTimer を、Clock
のクロック・ソースから Qt の内部クロック・ソース(QElapsedTimer::clockType() を参照)に変換して、deadline のタイム・ポイントでマークされた期限に設定します。
deadline が過去の場合、このQDeadlineTimer オブジェクトは期限切れに設定され、deadline がDuration::max()
と等しい場合、このオブジェクトは期限切れにならないように設定されます。
このQDeadlineTimer オブジェクトのタイマー・タイプは、指定されたtype に設定される。
hasExpired ()、isForever ()、remainingTime ()も参照 。
[noexcept]
void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs = 0, Qt::TimerType timerType = Qt::CoarseTimer)
このQDeadlineTimer オブジェクトの期限を、基準クロックエポックからのsecs 秒とnsecs ナノ秒に設定し(QElapsedTimer::msecsSinceReference() と同じ)、タイマータイプをtimerType に設定する。値が過去の場合、このQDeadlineTimer は期限切れとしてマークされる。
secs またはnsecs がstd::numeric_limits<qint64>::max()
の場合、このQDeadlineTimer は期限切れにならないように設定される。nsecs が10億ナノ秒(1秒)を超える場合、secs はそれに応じて調整される。
setDeadline()、deadline()、deadlineNSecs()、setRemainingTime()も参照のこと 。
[noexcept]
void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs = 0, Qt::TimerType timerType = Qt::CoarseTimer)
このQDeadlineTimer オブジェクトの残り時間を、secs が正の値の場合、secs 秒にnsecs ナノ秒を加えた値に設定する。secs が負の値の場合、このQDeadlineTimer は期限切れにならないように設定されます(この動作はnsecs には適用されません)。両方のパラメータがゼロの場合、このQDeadlineTimer は期限切れとしてマークされる。
最適化のため、secs とnsecs の両方がゼロの場合、この関数は現在時刻の取得を省略し、代わりに過去の既知の値を使用することがある。その場合、deadline ()は予期しない値を返すことがあり、このオブジェクトを期限切れ時間の計算に使用することはできない。そのような機能が必要な場合は、QDeadlineTimer::current() を使用し、それに時間を追加してください。
このQDeadlineTimer オブジェクトのタイマー・タイプは、指定されたtimerType に設定されます。
注意: Qt 6.6以前では、タイマーが期限切れにならない唯一の条件は、secs が -1 の場合でした。
setRemainingTime(),hasExpired(),isForever(),remainingTime()も参照してください 。
[noexcept]
void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer)
msecs に正の値がある場合、このQDeadlineTimer オブジェクトの残り時間をmsecs ミリ秒後に設定する。msecs がゼロの場合、このQDeadlineTimer オブジェクトは期限切れとしてマークされ、負の値の場合は期限切れにならないように設定されます。
最適化のため、msecs がゼロの場合、この関数は現在時刻の取得を省略し、代わりに過去の既知の値を使用することがある。その場合、deadline ()は予期しない値を返すことがあり、このオブジェクトを期限切れ時間の計算に使用することはできない。そのような機能が必要な場合は、QDeadlineTimer::current() を使用し、それに時間を追加してください。
このQDeadlineTimer オブジェクトのタイマー・タイプは、指定されたtimerType に設定されます。
注意: Qt 6.6以前では、タイマーが期限切れにならない唯一の値は-1でした。
setPreciseRemainingTime(),hasExpired(),isForever(),remainingTime()も参照してください 。
template <typename Rep, typename Period> void QDeadlineTimer::setRemainingTime(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type = Qt::CoarseTimer)
これはオーバーロードされた関数である。
このQDeadlineTimer オブジェクトの残り時間をremaining に設定します。remaining がゼロまたは負の場合、このQDeadlineTimer オブジェクトは期限切れとしてマークされ、remaining がduration::max()
と等しい場合、このオブジェクトは期限切れにならないように設定されます。
このQDeadlineTimer オブジェクトのタイマー・タイプは、指定されたtype に設定されます。
この関数は、C++14 のユーザー定義リテラル(in など)と一緒に使用できます:
using namespace std::chrono_literals; deadline.setRemainingTime(250ms);
注: Qt は、C++ 委員会の常設文書 6 の機能テスト勧告によって、必要な C++14 コンパイラのサポートを検出します。
setDeadline()、remainingTime()、hasExpired()、isForever()も参照して ください。
void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
このオブジェクトのタイマータイプをtimerType に変更します。
timerType Qt::PreciseTimer は Qt が見つけることができる最も正確なタイマーを使用し、分解能は 1 ミリ秒以上です。一方、 はより粗いタイマーを使用しようとし、 と はより粗いタイマーを使用しようとします。QDeadlineTimer Qt::CoarseTimer Qt::VeryCoarseTimer
timerType() とQt::TimerTypeも参照してください 。
[noexcept]
void QDeadlineTimer::swap(QDeadlineTimer &other)
このデッドライン・タイマーをother と交換する。この操作は非常に高速で、失敗することはない。
[noexcept]
Qt::TimerType QDeadlineTimer::timerType() const
このオブジェクトに対してアクティブなタイマー・タイプを返します。
setTimerType()も参照してください 。
QDeadlineTimer &QDeadlineTimer::operator+=(qint64 msecs)
このQDeadlineTimer オブジェクトをmsecs ミリ秒延長し、それ自身を返す。このオブジェクトが期限切れにならないように設定されている場合、この関数は何もしない。
1ミリ秒を超える精度の時間を追加するには、addNSecs ()を使用します。
QDeadlineTimer &QDeadlineTimer::operator-=(qint64 msecs)
このQDeadlineTimer オブジェクトをmsecs ミリ秒短縮し、それ自身を返す。このオブジェクトが期限切れにならないように設定されている場合、この関数は何もしない。
1ミリ秒より大きい精度の時間を引くには、addNSecs ()を使用する。
template <typename Rep, typename Period> QDeadlineTimer &QDeadlineTimer::operator=(std::chrono::duration<Rep, Period> remaining)
この期限タイマーをremaining の時刻に設定する。
template <typename Clock, typename Duration = typename Clock::duration> QDeadlineTimer &QDeadlineTimer::operator=(std::chrono::time_point<Clock, Duration> deadline_)
この期限タイマーにdeadline_ を割り当てる。
関連する非会員
[noexcept]
bool operator!=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs)
lhs のデッドラインとrhs のデッドラインが異なる場合は true を、そうでない場合は false を返す。2つの期限を作成するために使用されたタイマー・タイプは無視される。この関数は以下と等価である:
return lhs.deadlineNSecs() != rhs.deadlineNSecs();
注意: 異なるタイマー・タイプを持つQDeadlineTimer オブジェクトを比較することはサポートされておらず、予測できない動作になる可能性があります。
QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs)
dt に格納されたデッドラインよりmsecs が遅いデッドラインを持つQDeadlineTimer オブジェクトを返す。dt が期限切れにならないように設定されている場合、この関数は期限切れにならないQDeadlineTimer も返す。
1ミリ秒以上の精度の時間を追加するには、addNSecs ()を使用します。
QDeadlineTimer operator+(qint64 msecs, QDeadlineTimer dt)
dt に格納されたデッドラインよりmsecs が遅いデッドラインを持つQDeadlineTimer オブジェクトを返す。dt が期限切れにならないように設定されている場合、この関数は期限切れにならないQDeadlineTimer も返す。
1ミリ秒以上の精度の時間を追加するには、addNSecs ()を使用します。
QDeadlineTimer operator-(QDeadlineTimer dt, qint64 msecs)
dt に格納されている期限よりmsecs 前の期限を持つQDeadlineTimer オブジェクトを返す。dt が期限切れにならないように設定されている場合、この関数は期限切れにならないQDeadlineTimer も返す。
1ミリ秒を超える精度の時間を差し引くには、addNSecs ()を使用する。
[noexcept]
bool operator<(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs)
lhs のデッドラインがrhs のデッドラインより早ければ真を、そうでなければ偽を返す。2つの期限を作成するために使用されたタイマー・タイプは無視される。この関数は以下と等価である:
return lhs.deadlineNSecs() < rhs.deadlineNSecs();
注意: 異なるタイマー・タイプを持つQDeadlineTimer オブジェクトを比較することはサポートされておらず、予測できない動作になる可能性があります。
[noexcept]
bool operator<=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs)
lhs のデッドラインがrhs のデッドラインより早いか同じであれば真を、そうでなければ偽を返す。2つの期限を作成するために使用されたタイマー・タイプは無視される。この関数は以下と等価です:
return lhs.deadlineNSecs() <= rhs.deadlineNSecs();
注意: 異なるタイマー・タイプを持つQDeadlineTimer オブジェクトを比較することはサポートされておらず、予測できない動作になる可能性があります。
[noexcept]
bool operator==(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs)
lhs のデッドラインとrhs のデッドラインが同じであれば true、そうでなければ false を返す。2つの期限を作成するために使用されたタイマー・タイプは無視される。この関数は以下と等価です:
return lhs.deadlineNSecs() == rhs.deadlineNSecs();
注意: 異なるタイマー・タイプを持つQDeadlineTimer オブジェクトを比較することはサポートされておらず、予測できない動作になる可能性があります。
[noexcept]
bool operator>(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs)
lhs のデッドラインがrhs のデッドラインより遅ければ真を、そうでなければ偽を返す。2つの期限を作成するために使用されたタイマー・タイプは無視される。この関数は以下と等価である:
return lhs.deadlineNSecs() > rhs.deadlineNSecs();
注意: 異なるタイマー・タイプを持つQDeadlineTimer オブジェクトを比較することはサポートされておらず、予測できない動作になる可能性があります。
[noexcept]
bool operator>=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs)
lhs のデッドラインがrhs のデッドラインより遅いか同じであれば真を、そうでなければ偽を返す。2つの期限を作成するために使用されたタイマー・タイプは無視される。この関数は以下と等価です:
return lhs.deadlineNSecs() >= rhs.deadlineNSecs();
注意: 異なるタイマー・タイプを持つQDeadlineTimer オブジェクトを比較することはサポートされておらず、予測できない動作になる可能性があります。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.