Obsolete Members for QTimer
クラスQTimer の以下のメンバは非推奨である。これらは古いソース・コードの動作を維持するために提供されています。新しいコードでは使用しないことを強くお勧めします。
静的パブリック・メンバー
(deprecated in 6.8) void | singleShot(int msec, const QObject *receiver, const char *member) |
(deprecated in 6.8) void | singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member) |
メンバ関数ドキュメント
[static, deprecated in 6.8]
void QTimer::singleShot(int msec, const QObject *receiver, const char *member)
この関数は6.8から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
chronoオーバーロードを使用してください。この静的関数は、与えられた時間間隔の後にスロットを呼び出します。
この関数を使うと、わざわざtimerEvent を使ったり、ローカルのQTimer オブジェクトを作ったりする必要がないので、とても便利です。
例
#include <QApplication> #include <QTimer> int main(int argc, char *argv[]) { QApplication app(argc, argv); QTimer::singleShot(600000, &app, QCoreApplication::quit); ... return app.exec(); }
このサンプル・プログラムは、10分(60万ミリ秒)後に自動的に終了します。
receiver が受信オブジェクトで、member がスロットです。時間間隔はmsec ミリ秒です。
注意:この関数はリエントラントである。
start()も参照のこと 。
[static, deprecated in 6.8]
void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member)
この関数は6.8から非推奨となりました。新しいコードでは使用しないことを強くお勧めします。
これはオーバーロードされた関数です。
chronoのオーバーロードを使用してください。この静的関数は、与えられた時間間隔の後にスロットを呼び出します。
この関数を使うと、わざわざtimerEvent を使ったり、ローカルのQTimer オブジェクトを作ったりする必要がないので、とても便利です。
receiver が受信オブジェクトで、member がスロットです。時間間隔はmsec ミリ秒です。timerType はタイマーの精度に影響する。
注意:この関数はリエントラントである。
start()も参照のこと 。
© 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.