随笔分类 -  Qt_learning

学习Qt 学习方式:B站视频教学 记录笔记
qcustomplot绘图初始化
摘要:/* 绘图初始化设置 */ //绘制曲线初始化 customPlot = ui->widget; /***********************添加一条线并设置为蓝色****************************/ customPlot->addGraph(); customPlot-> 阅读全文
posted @ 2021-08-25 10:17 哆啦E梦 阅读(434) 评论(0) 推荐(0)
QT中Qplaintextedit中设置最大100行,到100行之后清空内容
摘要:ui->plainTextEdit->setMaximumBlockCount(100);//设置最多显示100行,到100行之后清空 阅读全文
posted @ 2021-08-24 10:54 哆啦E梦 阅读(2132) 评论(0) 推荐(1)
Qt计算帧数(qcustomplot)
摘要://计算帧数 // static double lastFpsKey; // static int frameCount; // ++frameCount; // if (key-lastFpsKey > 2) //每2秒求一次平均值 // { // //状态栏显示帧数和数据总数 // ui->st 阅读全文
posted @ 2021-08-20 10:32 哆啦E梦 阅读(1057) 评论(0) 推荐(0)
Qt中qcustomplot绘制曲线
摘要:/***********************添加一条线并设置为蓝色,线的区域用半透明蓝色填充****************************/ customPlot->addGraph(); customPlot->graph(0)->setPen(QPen(QColor(40, 110 阅读全文
posted @ 2021-08-20 09:24 哆啦E梦 阅读(319) 评论(0) 推荐(0)
Qt快捷键
摘要:alt+enter 快速在.cpp中添加槽函数 阅读全文
posted @ 2021-08-15 20:37 哆啦E梦 阅读(56) 评论(0) 推荐(0)
Qt中 QCustomPlot 库中的一段【文件保存代码】(save files)
摘要:void MainWindow::on_actionSave_Document_triggered() { QString fileName = QFileDialog::getSaveFileName(this, "Save document...", qApp->applicationDirPa 阅读全文
posted @ 2021-08-15 16:13 哆啦E梦 阅读(343) 评论(0) 推荐(0)
Qt文件中的“另存为”
摘要://获取保存路径 QString savepath = QFileDialog::getSaveFileName(this); //创建文件对象 QFile file(savepath); if(!file.open(QIODevice::ReadWrite)) //读写方式打开 { ui->sta 阅读全文
posted @ 2021-08-15 11:20 哆啦E梦 阅读(960) 评论(0) 推荐(0)
qt如何获取毫秒级时间戳?
摘要:QDateTime dateTime = QDateTime::currentDateTime(); // 字符串格式化 QString timestamp = dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz"); // 获取毫秒值 int ms = dateT 阅读全文
posted @ 2021-08-14 19:42 哆啦E梦 阅读(3038) 评论(0) 推荐(0)
Qt项目添加图标
摘要:将ico文件添加到项目文件夹中,例如:logo.ico 在.pro文件中加入以下语句 RC_ICONS = logo.ico 阅读全文
posted @ 2021-08-13 16:09 哆啦E梦 阅读(79) 评论(0) 推荐(0)
C++中的布尔类型(bool)
摘要:#include <iostream> using namespace std; int main(){ int a, b; bool flag; //定义布尔变量 cin>>a>>b; flag = a > b; cout<<"flag = "<<flag<<endl; return 0; } C 阅读全文
posted @ 2021-08-13 14:57 哆啦E梦 阅读(712) 评论(0) 推荐(0)
Qt 5.14.2 MinGW 32-bit示例——serial
摘要:翻译: 阅读全文
posted @ 2021-08-07 14:49 哆啦E梦 阅读(154) 评论(0) 推荐(0)
学习C++ 3天之后再看Qt程序
摘要:第一步:Qt 用到哪一项功能,需要在 ".pro" 中的 "QT += " 后面将该功能对应的类的名字写上;例如 QT += serialport 第二步:在“.h”文件中加入必要的头文件;例如 #include <QSerialPort> 第三步:槽slots的声明,这一步也是在“.h”文件中写; 阅读全文
posted @ 2021-08-07 10:09 哆啦E梦 阅读(139) 评论(0) 推荐(0)
Qt
摘要:语言:C++ 回调函数:Qt提供了一种称为signals/slots的安全类型来替代callback,使各个元件之间的协同工作变得十分简单 模块: Qt Core——Qt的核心,无论写任何程序,这个模块必须要有,所有其他模块都依赖于此模块 Qt编程第一步就是添加自己所需的模块名,在.pro文件中添加 阅读全文
posted @ 2021-08-04 11:36 哆啦E梦 阅读(368) 评论(0) 推荐(0)