![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Qt
csdn_gddf102384398
这个作者很懒,什么都没留下…
展开
-
qt使用Windows经典风格
在main函数中添加:a.setStyle(QStyleFactory::create("Windows"));即可。原创 2022-06-16 09:42:03 · 363 阅读 · 0 评论 -
CentOS7搭建Qt5.14.2开发环境遇到的坑和解决方法
1、首先Windows下载.run文件,移动到Linux上后,chmod +x ,root执行,报错“No marker found, stopped after 1.00 MiB”,解决:在Linux下浏览器下载.run安装文件,然后执行;特别注意,Qt安装时如果选择了Qt Desktop gcc选项,这并不是指会额外安装gcc编译器。2、安装时最好断网,否则会提示输入注册账号,麻烦;3、新建工程编译报错,提示需要C++11支持,这是因为系统的gcc编译器版本太低,参考如下链接解决:cento原创 2022-05-03 12:53:57 · 1555 阅读 · 0 评论 -
Qt设置窗口坐标原点和x,y轴方向
下面代码设置窗口中心为坐标原点,x轴水平向右增长,y轴竖直向上增长。p.setWindow(w / 2, h / 2, w, -h);p.translate(w , 0 );原创 2020-12-13 14:35:37 · 2332 阅读 · 0 评论 -
QTableView使用方法
model = new QStandardItemModel; ui.tableView->setModel(model); model->setHorizontalHeaderLabels(QStringList() <<QString::fromLocal8Bit("第一列") <<QString::fromLocal8Bit("第二列") <<QString::fromLocal8Bit("第三列")); for (int i =原创 2020-12-12 20:37:29 · 318 阅读 · 0 评论 -
Qt文件操作
QFile file(“test1.txt”);file.open(QIODevice::ReadWrite);//以读写方式打开文件,若文件存在,读写指针位于文件开始处;若文件不存在则创建file.open(QIODevice::ReadWrite|QIODevice::Truncate);//以读写方式打开文件,若文件存在,则文件内容被清除...原创 2020-06-15 15:44:55 · 193 阅读 · 0 评论 -
Qt使用正则表达式从字符串中提取数值
QStringList getNumListFromStr(const QString& str){ QRegExp rx("-?[1-9]\\d*\\.\\d*|-?0\\.\\d*[1-9]\\d*|-?\\d+"); QStringList lst; int pos=0; while((pos=rx.indexIn(str,pos))!=-1) ...原创 2020-04-21 14:07:53 · 3256 阅读 · 0 评论