本示例为5.15.2版本
使用QFutureWatcher 检测进度信息
1 QFutureWatcher<void> futureWatcher;
1
QFutureWatcher<void> futureWatcher;
通过信号槽与进度对话框进行关联。
调用setFuture开始。
实现了什么功能 客户端 用到的知识点 使用了QDialogButtonBox,一个作为ActionRole,一个作为RejectRole, QLocalServer为服务端, QLocalSocket是客户端。 部分源码解析 1 2 3 4 5 6 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint...
这个示例与上一个类似,只是使用了QTcpServer和 QTcpSocket 服务端 用到了 QTcpServer 1 2 3 4 5 6 QTcpServer::newConnection信号收到后,就 tcpServer->nextPendingConnection();发送数据,最后disconnectFromHost(); 其它: Qt::TextBrowserIntera...
实现了什么功能 可以根据窗口大小,自动将控件换行. 用到哪些重要的类 QLayout 部分源码解析 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 子类化QLayout,需要重新实现一些函数。具体见帮助文档 addItem将item放在一个list中。takeAt删除并返回。 计算水平和垂直间距时,用到了QStyle::Pix...
C++系列1:optional
GN系列2:入门