摘要: https://blog.csdn.net/qq_22642239/article/details/84822485 多字节字符集:使用一个或者多个字节表示一个字符Unicode字符集:统一使用2个字节表示一个字符,其中UTF-8,UTF-16,UTF-32都属于Unicode的编码规则UTF-8: 阅读全文
posted @ 2019-05-28 11:02 Truman001 阅读(590) 评论(0) 推荐(0) 编辑
摘要: 在用QT编程时,有时候要实现鼠标右键弹出菜单的功能.下面代码演示鼠标右键弹出菜单. 1.新建一个QT工程,点击MainWindow.ui,鼠标右键Go to slot.....,添加customContextMenuRequested(const QPoint &pos)事件 2.找到属性页中的co 阅读全文
posted @ 2019-05-24 15:45 Truman001 阅读(5783) 评论(0) 推荐(1) 编辑
摘要: C++单例模式析构函数的应用 https://blog.csdn.net/realxie/article/details/7090493 C++实现线程安全的单例模式 https://www.cnblogs.com/myd620/p/6133420.html 阅读全文
posted @ 2019-05-22 10:16 Truman001 阅读(1107) 评论(0) 推荐(0) 编辑
摘要: //在main函数中加载qss文件 QFile file(QDir::currentPath() + "/ui.qss"); if (file.open(QFile::ReadOnly)) { QString stylesheet = QLatin1String(file.readAll()); qApp->setStyleSheet(stylesheet); file.... 阅读全文
posted @ 2019-05-22 09:21 Truman001 阅读(1028) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/Pig_Pig_Bang/article/details/81632962 阅读全文
posted @ 2019-05-21 17:26 Truman001 阅读(828) 评论(0) 推荐(0) 编辑
摘要: 1.visual assistx: C++开发必备2.code alignment: 代码对齐工具,可以对齐等号等,让代码更美观3.ForceUTF8: 文件强制保存为utf-8无bom格式4.Indent Guides: 缩进显示竖线5.VsVIM: vim模拟器 6 AStyle,格式化代码 阅读全文
posted @ 2019-05-21 10:48 Truman001 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 在所需页面调用installEventFilter函数,如下: m_processcfg_widget->installEventFilter(this); 阅读全文
posted @ 2019-05-20 18:04 Truman001 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 需求: 下拉列表有复选功能 不可编辑 显示所有选中项 关于QComboBox的复选功能有几种方案: QStandardItemModel + QStandardItem QListWidget + QListWidgetItem Model/View + QItemDelegate 当然,还有其它更 阅读全文
posted @ 2019-05-20 17:57 Truman001 阅读(1882) 评论(1) 推荐(0) 编辑
摘要: 2 std::string转为QString(中文字符) 3 QString转为std::string(全英文字符) 4 QString转为std::string(中文字符) 5 QString转为int 6 int转为QString 8 int 转为std::string 10 char*转为st 阅读全文
posted @ 2019-05-17 10:10 Truman001 阅读(405) 评论(0) 推荐(0) 编辑
摘要: m_simdeviceweiget->setMinimumSize(250, 50 + m_simdeviceaddno * 30); m_simdeviceweiget->setMaximumSize(250, 50 + m_simdeviceaddno * 30); QHBoxLayout *l 阅读全文
posted @ 2019-05-17 09:44 Truman001 阅读(720) 评论(0) 推荐(0) 编辑