随笔分类 - Qt_learning
学习Qt
学习方式:B站视频教学
记录笔记
qcustomplot绘图初始化
摘要:/* 绘图初始化设置 */ //绘制曲线初始化 customPlot = ui->widget; /***********************添加一条线并设置为蓝色****************************/ customPlot->addGraph(); customPlot->
阅读全文
QT中Qplaintextedit中设置最大100行,到100行之后清空内容
摘要:ui->plainTextEdit->setMaximumBlockCount(100);//设置最多显示100行,到100行之后清空
阅读全文
Qt计算帧数(qcustomplot)
摘要://计算帧数 // static double lastFpsKey; // static int frameCount; // ++frameCount; // if (key-lastFpsKey > 2) //每2秒求一次平均值 // { // //状态栏显示帧数和数据总数 // ui->st
阅读全文
Qt中qcustomplot绘制曲线
摘要:/***********************添加一条线并设置为蓝色,线的区域用半透明蓝色填充****************************/ customPlot->addGraph(); customPlot->graph(0)->setPen(QPen(QColor(40, 110
阅读全文
Qt中 QCustomPlot 库中的一段【文件保存代码】(save files)
摘要:void MainWindow::on_actionSave_Document_triggered() { QString fileName = QFileDialog::getSaveFileName(this, "Save document...", qApp->applicationDirPa
阅读全文
Qt文件中的“另存为”
摘要://获取保存路径 QString savepath = QFileDialog::getSaveFileName(this); //创建文件对象 QFile file(savepath); if(!file.open(QIODevice::ReadWrite)) //读写方式打开 { ui->sta
阅读全文
qt如何获取毫秒级时间戳?
摘要:QDateTime dateTime = QDateTime::currentDateTime(); // 字符串格式化 QString timestamp = dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz"); // 获取毫秒值 int ms = dateT
阅读全文
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
阅读全文
学习C++ 3天之后再看Qt程序
摘要:第一步:Qt 用到哪一项功能,需要在 ".pro" 中的 "QT += " 后面将该功能对应的类的名字写上;例如 QT += serialport 第二步:在“.h”文件中加入必要的头文件;例如 #include <QSerialPort> 第三步:槽slots的声明,这一步也是在“.h”文件中写;
阅读全文
浙公网安备 33010602011771号