简体   繁体   中英

How to show data from a thread to status bar in QT C++?

I'm currently working on a project where I have threads that handle user requests, I'm tring to find a way so when user send request I show some information about this user and the request on the main widget's status bar (on the server side) how can I do this?

You just need to call this method to show a message in the status bar:

void QStatusBar::showMessage(const QString &message, int timeout = 0)

This is also a slot, so you can also invoke it through a signal-slot connection if you like.

You will need to parse the data from your QTcpSocket before you can display what you want for sure. You need to connect to this signal for example:

void QIODevice::readyRead()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM