2023年5月5日
摘要:
1、常用键盘事件 上下左右 event.key Qt.Key_Up event.key Qt.Key_Down event.key Qt.Key_Left event.key Qt.Key_Right 回车 event.key Qt.Key_Enter || event.key Qt.Key_Ret
阅读全文
posted @ 2023-05-05 16:07
缘随风烬
阅读(361)
推荐(0)
2022年7月29日
摘要:
串口的烧录的本质还是串口通信,只是多了对DTR和RTS引脚电平的设置,单片机要求需要有CH340类模块 方法: serial->setDataTerminalReady(bool); serial->setRequestToSend(bool); 通过这两个引脚我们就可以控制单片机使其进入相应的模式
阅读全文
posted @ 2022-07-29 15:53
缘随风烬
阅读(1030)
推荐(0)
摘要:
当我们在使用.exec()函数时,会发现我们使用qApp.quit()函数不会生效,原因是quit函数在事件循环开始之前是没有生效的,所以不论我们怎么变,都不会退出程序。 解决方式: 这个是原始的mian()函数 int main() { QCoreApplication a; .... retur
阅读全文
posted @ 2022-07-29 15:41
缘随风烬
阅读(842)
推荐(0)
2022年3月24日
摘要:
//缺点:工厂类集中了所有产品类的创建逻辑,如果产品量较大,会使得工厂类变的非常臃肿。#include <iostream> #include <string> using namespace std; class Cost{ public: virtual const string& color(
阅读全文
posted @ 2022-03-24 12:00
缘随风烬
阅读(104)
推荐(0)
2022年3月16日
摘要:
1、在C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64下找到rc.exe和rcdll.dll注意版本x64表示64位的,然后复制到编译器下。例如D:\QT_5.12_install\5.12.7\msvc2017_64\bin目录
阅读全文
posted @ 2022-03-16 15:14
缘随风烬
阅读(255)
推荐(0)
2022年1月24日
摘要:
注意权限为root 1、 cd /etc/networks 2、打开或新建文件 vim interfaces 3、输入命令 auto lo iface lo inet loopback auto ens33 // ens33表示的是网卡 iface ens33 inet static address
阅读全文
posted @ 2022-01-24 15:26
缘随风烬
阅读(282)
推荐(0)
摘要:
// 设置显示的位数 ui->lcdNumber->setDigitCount(19); // 设置显示的模式为十进制 ui->lcdNumber->setMode(QLCDNumber::Dec); // 设置显示外观 ui->lcdNumber->setSegmentStyle(QLCDNumb
阅读全文
posted @ 2022-01-24 11:31
缘随风烬
阅读(942)
推荐(0)
2022年1月21日
摘要:
// tcp.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <winsock.h> #pragma comment(lib, "ws2_32.lib") using namespace std; vo
阅读全文
posted @ 2022-01-21 17:09
缘随风烬
阅读(529)
推荐(0)
2021年12月16日
摘要:
1、实现图片的自适应,我们需要用到,一个自带的事件void resizeEvent(QResizeEvent *);该函数会在你运行程序的时候执行一次,在变换一次窗口的时候也会运行一次。 具体代码如下: #include "mainwindow.h" #include "ui_mainwindow.
阅读全文
posted @ 2021-12-16 11:20
缘随风烬
阅读(1242)
推荐(0)
2021年9月23日
摘要:
import QtQuick 2.0 import QtQuick.Controls 1.4 Canvas { id: root // canvas size width: 200; height: 200 // handler to override for drawing onPaint: {
阅读全文
posted @ 2021-09-23 15:30
缘随风烬
阅读(128)
推荐(0)