04 2019 档案

摘要:QString 转换成 LPWSTR LPWSTR lpStr = (LPWSTR) QString("nihao").toStdWString().c_str(); 阅读全文
posted @ 2019-04-28 14:27 时光旅者 阅读(2133) 评论(0) 推荐(0)
摘要:如果将std::cin建立在主线程,将阻塞主线程的所有事件循环,因而要保证事件循环不受影响,需要将std::cin放到 子线程中。同时,如果要实现能够强制终止std::cin阻塞, 可以通过强制终止线程的方式来实现。 即 开启输入: 强制关闭线程: 阅读全文
posted @ 2019-04-26 15:16 时光旅者 阅读(1539) 评论(0) 推荐(0)
摘要:QTcpServer提供了newConnection信号, 可以通过connect实现连接槽函数,利用nextPendingConnection 函数获取连接的QTcpSocket * ;也可以继承QTcpServer派生, 复写虚函数incomingConnection(在连接上时, 会自动触发该 阅读全文
posted @ 2019-04-26 15:02 时光旅者 阅读(5944) 评论(1) 推荐(0)
摘要:QProcess p(NULL); p.setWorkingDirectory(szAppPath+"/database"); //指定工作路径,这个地方一定要设置; p.start(szCmd); //开进程执行命令; while(p.state() != QProcess::NotRunning... 阅读全文
posted @ 2019-04-10 14:36 时光旅者 阅读(3214) 评论(1) 推荐(0)
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #define UEVENT_BUFFER_SIZE 2048 static int init_hotplug_sock() { co... 阅读全文
posted @ 2019-04-04 16:12 时光旅者 阅读(1675) 评论(0) 推荐(0)
摘要:Qt提供了QAbstractNativeEventFilter来实现本地时间得过滤,通过对本地事件的检测,判断usb热插拔;(这里是windows 的例子); 首先,以QWidget, QAbstractNativeEventFilter为基类建立子类,重定义nativeEventFilter: 譬 阅读全文
posted @ 2019-04-04 16:04 时光旅者 阅读(6826) 评论(0) 推荐(0)