QtTaskTree::QTcpSocketWrapper Class
class QtTaskTree::QTcpSocketWrapperQTcpSocket 를 감싸는 래퍼입니다. 더 보기...
| 헤더: | #include <qtcpsocketwrappertask.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS TaskTree) target_link_libraries(mytarget PRIVATE Qt6::TaskTree) |
| qmake: | QT += tasktree |
| 다음 버전부터: | Qt 6.11 |
| 상속: | QObject |
| 상태: | 기술 미리보기 |
이 클래스는 기술 미리보기 단계에 있으며 변경될 수 있습니다.
참고: 이 클래스의 모든 함수는 재진입 가능합니다.
공개 함수
| QTcpSocketWrapper(QObject *parent) | |
| virtual | ~QTcpSocketWrapper() override |
| void | setAddress(const QHostAddress &address) |
| void | setData(const QByteArray &data) |
| void | setPort(quint16 port) |
| QTcpSocket * | socket() const |
| void | start() |
신호
재구현된 보호 함수
| virtual bool | event(QEvent *event) override |
상세 설명
QTcpSocketWrapper는 QTcpSocket 를 편리하게 감싸는 래퍼입니다.
start()을 호출하기 전에 setAddress(), setPort(), setData()을 사용하여 QTcpSocketWrapper를 구성하십시오.
래핑된 QTcpSocket 는 socket() 메서드를 통해 접근할 수 있습니다. QTcpSocket 는 start() 메서드에 의해 동적으로 생성되며 QTcpSocketWrapper에 의해 관리됩니다. 이 객체는 done() 신호가 발송된 직후 삭제됩니다.
멤버 함수 문서
[explicit] QTcpSocketWrapper::QTcpSocketWrapper(QObject *parent)
지정된 ` parent`을 사용하여 `QTcpSocketWrapper`를 생성합니다.
[override virtual noexcept] QTcpSocketWrapper::~QTcpSocketWrapper()
QTcpSocketWrapper 를 삭제합니다. 관련 socket()가 아직 실행 중이라면, 해당 작업이 중단됩니다.
[signal] void QTcpSocketWrapper::done(QtTaskTree::DoneResult result)
이 신호는 관련 QTcpSocket 가 완료된 후에 발생합니다. 전달된 result 는 작업이 성공적으로 완료되었는지, 아니면 오류가 발생했는지를 나타냅니다.
socket()도 참조하십시오 .
[override virtual protected] bool QTcpSocketWrapper::event(QEvent *event)
QObject::event(QEvent *e)를 재구현합니다.
void QTcpSocketWrapper::setAddress(const QHostAddress &address)
start()에서 사용할 ` address `를 설정합니다.
void QTcpSocketWrapper::setData(const QByteArray &data)
start()에서 사용할 data 을 설정합니다. 값이 비어 있지 않으면, 연결이 설정된 후 data 가 소켓에 자동으로 기록됩니다.
void QTcpSocketWrapper::setPort(quint16 port)
start()에서 사용할 port 를 설정합니다.
QTcpSocket *QTcpSocketWrapper::socket() const
연관된 ` QTcpSocket`에 대한 포인터를 반환합니다. ` QTcpSocketWrapper `가 시작되기 전과 종료된 후에는, 이 함수가 ` nullptr`를 반환합니다. ` started()` 신호가 발송된 후부터 ` done()` 신호가 발송되기 전까지는 ` QTcpSocket `에 안전하게 접근할 수 있습니다.
void QTcpSocketWrapper::start()
QTcpSocketWrapper 를 시작합니다.
[signal] void QTcpSocketWrapper::started()
이 신호는 관리형 QTcpSocket 가 연결된 후에 발생합니다.
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.