多线程+串口读数据 [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...
by snowyhm - Linux文档专区 - 2007-11-20 11:04:03 阅读(827) 回复(0)
本帖最后由 c/unix 于 2010-11-18 12:11 编辑 附件: 说明: 1,刚写的一个测试板子的小程序,串口操作用的是一个开源第3方类库,qextserial,网上有相关介绍和下载。 2,程序运行在windows系统,直接用qt creator即可运行。 3,如需移植到linux系统,只需替换对应的qextserial文件即可。 截图:
[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...
[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...
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
你知道qt都提供了哪些工具吗? 你知道qt的这些工具都有哪些功能吗? 看看你对qt的工具到底了解多少呢? 不看不知道,一看保你吓一跳!
一级题目:qt Designer — 所见即所得的界面设计工具, 可以用拖拽的方式将控件排布在界面上,支持layout, 支持signal/slot编辑。 生成的文件保存为ui格式, ui...
使用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...
我从奇趣的ftp下了一个,版本是0.7的,可是使用时总是报段错误,搞不清楚怎么回事,我的是qte3.3.5,哪位以前在qt3里使用过请帮忙发一个吧 ,急用 ,谢谢!! 它的最新版本好像只能在qt4用,郁闷。。。。 email:seawar@126.com
qt通过三种形式提供了对线程的支持。它们分别是,一、平台无关的线程类,二、线程安全的事件投递,三、跨线程的信号-槽连接。这使得开发轻巧 的多 线程qt程序更为容易,并能充分利用多处理器机器的优势。多线程编程也是一个有用的模式,它用于解决执行较长时间的操作而不至于用户界面失去响应。在qt 的早期版本中,在构建库时有不选择线程支持的选项,从4.0开始,线程总是有效的。线程类...