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부터 더 이상 사용되지 않습니다. 새 코드에 사용하지 않는 것이 좋습니다.
크로노 오버로드 사용. 이 정적 함수는 주어진 시간 간격 후에 슬롯을 호출합니다.
이 함수를 사용하면 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분(600,000밀리초) 후에 자동으로 종료됩니다.
receiver 은 수신 객체이고 member 은 슬롯입니다. 시간 간격은 msec 밀리초입니다.
Qt 6.10부터 음수 간격을 설정하면 런타임 경고가 발생하고 값이 1ms로 재설정됩니다. Qt 6.10 이전에는 음수 간격을 설정할 수 있었지만 타이머가 실행 중일 때 멈추거나 아예 시작하지 않는 등 의외의 방식으로 동작했습니다.
참고: 이 함수는 재진입 기능입니다.
start()도 참조하세요 .
[static, deprecated in 6.8]
void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member)
이 함수는 6.8부터 더 이상 사용되지 않습니다. 새 코드에 사용하지 않는 것이 좋습니다.
크로노 오버로드 사용. 이 정적 함수는 주어진 시간 간격 후에 슬롯을 호출합니다.
이 함수를 사용하면 timerEvent 또는 로컬 QTimer 객체를 만들 필요가 없으므로 매우 편리합니다.
receiver 은 수신 객체이고 member 은 슬롯입니다. 시간 간격은 msec 밀리초입니다. timerType 은 타이머의 정확도에 영향을 줍니다.
Qt 6.10부터 음수 간격을 설정하면 런타임 경고가 발생하고 값이 1ms로 재설정됩니다. Qt 6.10 이전에는 음수 간격을 설정해도 타이머가 실행 중일 때 멈추거나 아예 시작하지 않는 등 예상치 못한 방식으로 작동했습니다(예: 타이머가 실행 중일 때 멈춤).
이것은 오버로드된 함수입니다.
참고: 이 함수는 재진입 함수입니다.
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.