Qt5: How to wait for a signal in a thread?

后端 未结 4 1877
一个人的身影
一个人的身影 2021-01-31 04:46

Probably the title question is not very explicit. I am using Qt5 on Windows7.

In a thread (QThread) at some point, in the \"process()\" function/method, I m

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-31 05:33

    I had some time these days and I did some investigation...
    Well, I browsed "http://doc.qt.io/qt-5/qsslsocket.html" and found this:

    bool QSslSocket::waitForEncrypted(int msecs = 30000)
    

    To my real shame, I didn't noticed it before... :(
    Definitely need to buy some glasses (unfortunately, it's not a joke!)
    I am willing to modify my code accordingly in order to test it (on Monday @ office).
    Pretty much chances that it'll work.
    [Late edit]:
    Yes, this is the solution I implemented in my final code and it works well, so I decided to share :)

提交回复
热议问题