![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
QT
cqumzh123456
这个作者很懒,什么都没留下…
展开
-
QT与boost asio共存WinSock.h has already been included问题
最近在做一项目,使用QT+boost asio,编译时出现编译错误:WinSock.h has already been included,只要把boost asio库的包含文件放到QT包含文件之前即可,如原先包含顺序: #include 改为:#include #include 即可解决问题。原创 2014-08-15 09:43:41 · 1154 阅读 · 0 评论 -
C++ 获取汉字拼音首字母(支持GBK)QT版
直接上代码,QT5.4下编译通过QString getFirstLetter(QString strName){ static int li_SecPosValue[] = { 1601, 1637, 1833, 2078, 2274, 2302, 2433, 2594, 2787, 3106, 3212, 3472, 3635, 3722, 3730,原创 2015-01-29 14:28:24 · 1237 阅读 · 0 评论 -
c++非常有用的解析协议用的一个辅助类
vs2013下编译通过 ByteStream.h#pragma once#include "Define.h"class ByteStream{public: ByteStream(uint32_t reserveSize); ~ByteStream(); void writeUInt32(uint32_t value); void writeInt32(int32_t原创 2015-11-11 16:09:59 · 1624 阅读 · 0 评论 -
qt 输出一年中每一天在未来10年正好在周末的次数及具体时间
int yearCnt = 10; int beginYear = 2016; QDate date(beginYear, 1, 1); QMapQString, int> result; QMapQString, QString> desc; while(date.year() beginYear + yearCnt) {原创 2015-12-14 17:29:11 · 424 阅读 · 0 评论 -
qt5 unicode 转中文 utf8
QString unicodeToUtf8(const QString& unicode){ QString result; int index = unicode.indexOf("\\u"); while (index != -1) { QString s1 = unicode.mid(index + 2, 4); result原创 2015-12-14 17:22:02 · 2885 阅读 · 0 评论 -
QT实现打开文件所在目录并选中文件
网上搜的都是调用 shellexecute来实现,其实用QProcess实现就可以了,代码如下: QProcess process; process.startDetached(QStringLiteral("explorer.exe /select,\"C:\\test.txt\""));原创 2016-04-06 16:07:51 · 7376 阅读 · 0 评论 -
QT生成excel文件
QAxObject excel("Excel.Application"); excel.setProperty("Visible",false); std::shared_ptr noUsed(NULL, [&](void*) { excel.dynamicCall("Quit(void)"); //退出 }); QAxObject *w原创 2016-04-13 11:22:34 · 2803 阅读 · 0 评论 -
Qt下如何使用libuv
以qt5.5 msvc2013 32位版例:1、当然是.pro文件中添加相当的头文件和库了:win32:CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -llibuvelse:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/lib/ -llibuvINCLUDEPATH原创 2015-11-11 15:57:37 · 3380 阅读 · 0 评论