摘要: 鼠标事件和滚轮事件QMouseEvent类用来表示一个鼠标事件,在窗口部件中按下鼠标或者移动鼠标指针时,都会产生鼠标事件。通过QMouseEvent类可以获取鼠标是哪个键被按下、鼠标指针(光标)的当前位置。QWheelEvent类用来表示鼠标滚轮事件,主要用来获取滚轮移动的方向和距离。 代码 wid 阅读全文
posted @ 2021-10-13 18:07 朱元叹 阅读(1121) 评论(0) 推荐(0)
摘要: QT中的事件事件是对各种应用程序需要知道的由应用程序内部或者外部产生的事情或者动作的通称。 事件处理... 事件传递事件是先传递给指定窗口部件的,确切地说应该是先传递给获得焦点的窗口部件。如果该部件忽略掉该事件,那么这个事件就会传递给这个部件的父部件。重新实现事件处理函数时,一般要调用父类的相应事件 阅读全文
posted @ 2021-10-13 15:57 朱元叹 阅读(56) 评论(0) 推荐(0)
摘要: 代码 #pragma execution_character_set("utf-8") #include <QTableView> #include <QStandardItemModel> #include <QApplication> class myWidget : public QTable 阅读全文
posted @ 2021-10-12 18:28 朱元叹 阅读(51) 评论(0) 推荐(0)
摘要: 工作中遇到的一个bug:web前台下发非ip地址导致web退出登录 增加后台对ip地址的合法性校验 1 #include <regex> 2 static bool IsIp(const char *ip) { 3 if (ip == NULL) { 4 return false; 5 } 6 st 阅读全文
posted @ 2021-09-23 16:46 朱元叹 阅读(961) 评论(0) 推荐(0)
摘要: GPIO基础知识 4种输入模式: 输入浮空 输入上拉 输入下拉 模拟输入 4种输出模式: 开漏输出 开漏复用功能 推挽式输出 推挽式复用功能 3种最大输出速度: 2MHz 10MHz 50MHz 每组IO口含下面7个寄存器,7个寄存器一共可以控制一组GPIO的16个IO口 GPIOx_CRL:端口配 阅读全文
posted @ 2021-09-16 13:54 朱元叹 阅读(247) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(docume 阅读全文
posted @ 2021-09-02 13:54 朱元叹 阅读(46) 评论(0) 推荐(0)
摘要: <html> <head> <meta charset="utf-8"> <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"> </script> <style type="text/css"> .testTips 阅读全文
posted @ 2021-09-02 10:32 朱元叹 阅读(439) 评论(0) 推荐(0)
摘要: QLabel用于显示文本 #include "widget.h" #include "ui_widget.h" Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { ui->setupUi(this); se 阅读全文
posted @ 2021-08-24 11:05 朱元叹 阅读(311) 评论(0) 推荐(0)
摘要: 1.位图资源加载方法:待补充 代码 #include "widget.h" #include "ui_widget.h" #include <QIcon> #include <QPixmap> Widget::Widget(QWidget *parent) : QWidget(parent) , u 阅读全文
posted @ 2021-08-20 14:05 朱元叹 阅读(95) 评论(0) 推荐(0)
摘要: 1 #include "mainwindow.h" 2 #include "ui_mainwindow.h" 3 #include <QString> 4 #include <QSpinBox> 5 #include <QDebug> 6 7 MainWindow::MainWindow(QWidg 阅读全文
posted @ 2021-08-06 09:23 朱元叹 阅读(100) 评论(0) 推荐(0)