Qt
来,旺财
简单写写Thanks♪(・ω・)ノ
展开
-
QT通过滑动条实现合成颜色
1.前言QT里可以通过滑动条Slider控制文本控件textEdit,进行合成各种颜色2.演示3.原理首先创建4个horizontalSlider和textEdit,分别命名代表RGB和透明度Alpha(注意:最大值都统一设置为255) ui->setupUi(this);//在构造函数写入槽函数 connect(ui->GreenSlider,SIGNAL(valueChanged(int)), th...原创 2020-08-05 16:24:59 · 1330 阅读 · 0 评论 -
QT忽略参数警告方法
1.前言使用某些特定的函数会自带参数,如果不使用会出现警告2. 演示//在使用某些槽函数会出现如下面的const QPoint &posvoid MainWindow::on_listWidget_customContextMenuRequested(const QPoint &pos){ Q_UNUSED(pos);//使用Q_UNUSED对参数进行屏蔽警告}3.原理Q_UNUSED(name)Indicates to the compile原创 2020-08-03 08:06:09 · 1494 阅读 · 0 评论 -
QT串口使用
1.前言Qt5.0以上都是使用官方的串口库,简单几步操作就可以使用。2.演示//首先是pro文件加入官方串口库信息QT += serialport//mainwindow.h里加入串口头文件#include <QtSerialPort/QSerialPort>#include <QtSerialPort/QSerialPortInfo>...原创 2018-12-20 15:10:35 · 915 阅读 · 2 评论