[serial.cpp] #include #include #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc,argv); MainWindow m; a.setMainWidget(&m); m.show(); return a.exec(); } [mainwindow.h] #ifndef MAIN_WINDOW_H #define MAIN_WINDOW_H #include class QLabel; class QPushButton; class QLineEdit; class QPixmap; class SerialThread; class MainWindow:public QMainWi...
by yqliu29 - Linux文档专区 - 2008-06-12 21:01:26 阅读(574) 回复(0)
[serial.cpp] #include #include #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc,argv); MainWindow m; a.setMainWidget(&m); m.show(); return a.exec(); } [mainwindow.h] #ifndef MAIN_WINDOW_H #define MAIN_WINDOW_H #include class QLabel; class QPushButton; class QLineEdit; class QPixmap; class SerialThread; class MainWindow:public QMainWin...
http://xizhizhu.blogspot.com/2009/01/qt-development-vi-tcp-communication.html 1.qtcpSocket qtcpSocket is used as the TCP socket in qt. It's used both in client and server side. To perform as a client, following steps are used: a) call qtcpSocket.connectToHost() to connect to a server; b) when connected, qtcpSocket.connected() will be emitted; c) communicate with the server. The following code ...
qt4的 文件: qextserialport-1.1.tar.gz 大小: 189KB 下载: 下载 qt3的 文件: qextserialport-0.9.0.tar.gz 大小: 49KB 下载: 下载 文件: qextserialport-0.8.0.tar.gz 大小: 49KB 下载: 下载 都是封装好的qt类可以直接拿来就用,qextserialport-1.1.tar.gz有实例程序! 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/67823/showart_680050.html
http://xizhizhu.blogspot.com/2009/01/qt-development-vii-ssl-communication.html SSL is widely used nowadays to provide secure communication, whichperforms as a new layer between TCP and application. In qt, theQSslSocket class provides an SSL encrypted socket for both servers andclients. 1.Client The following steps are most commonly used: a) call QSslSocket.setProtocol() and other functions to se...
多线程+串口读数据 [serial.cpp] #include #include #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc,argv); MainWindow m; a.setMainWidget(&m); m.show(); return a.exec(); } [mainwindow.h] #ifndef MAIN_WINDOW_H #define MAIN_WINDOW_H #include class QLabel; class QPushButton; class QLineEdit; class QPixmap; class SerialThread; class M...
最近的 软件工程 课程设计让我重新开始使用qt,上次数据结构的 课程设计 也是用qt,虽然是做出来了,但是现在想想,那个时候对qt的理解,或者说得更广一点,对OO的理解,简直太差劲了,当然,人的知识是进步的,所以现在有这样的感受是很正常的。虽然整体的开发工作还没有完全结束,但是已经有了很多心得体会,所以特来记录分享一下。 我们的系统采用的是C/S结构,所以客户端与 服务器 通信是最关键,不幸的是,虽然我们没有用过...
本帖最后由 c/unix 于 2010-11-18 12:11 编辑 附件: 说明: 1,刚写的一个测试板子的小程序,串口操作用的是一个开源第3方类库,qextserial,网上有相关介绍和下载。 2,程序运行在windows系统,直接用qt creator即可运行。 3,如需移植到linux系统,只需替换对应的qextserial文件即可。 截图:
使用qt作主界面,通过串口操作GPRS实现打电话,发短信 //首先解决串口操作的问题 #ifndef UARTIO_H #define UARTIO_H int open_uart(char *fname); int set_uart_speed(int fd, int speed); int set_uart_parity(int fd, int databits, int stopbits, int parity); ssize_t read_uart_timeout(int fd, void *buf, size_t count, int timeout); #endif #include //串口头文件 #include #include #include #include int __spee...