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분(600,000 밀리초) 후에 자동으로 종료됩니다.

receiver 는 수신 객체이고, member 는 슬롯입니다. 시간 간격은 msec 밀리초입니다.

Qt 6.10부터는 음수의 간격을 설정하면 런타임 경고가 발생하며 값이 1ms로 재설정됩니다. Qt 6.10 이전 버전에서는 Qt Timer에서 음수 간격을 설정할 수 있었지만, 예상치 못한 방식으로 동작했습니다(예를 들어, 타이머가 실행 중이면 중지되거나 아예 시작되지 않는 경우 등).

참고: 이 함수는 재진입 가능합니다.

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 는 타이머의 정확도에 영향을 미칩니다.

Qt 6.10부터는 음수의 간격을 설정하면 런타임 경고가 발생하고 값이 1ms로 재설정됩니다. Qt 6.10 이전 버전에서는 Qt Timer에서 음수 간격을 설정할 수 있었지만, 예상치 못한 방식으로 동작했습니다(예: 실행 중인 타이머가 중지되거나 아예 시작되지 않는 경우 등).

이 함수는 오버로드된 함수입니다.

참고: 이 함수는 재진입 가능합니다.

start()도 참조하십시오 .

© 2026 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.