Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
my_click_label.cpp 365 Bytes
Copy Edit Raw Blame History
全糖咖啡 authored 2023-01-13 16:07 . first
#include "my_click_label.h"
#include <Qt>
#include <QMouseEvent>
#include <QWidget>
MyClickLabel::MyClickLabel(QWidget *parent):QLabel(parent)
{
}
// 重写鼠标释放时间 mouseReleaseEvent()
void MyClickLabel::mouseReleaseEvent(QMouseEvent *ev)
{
Q_UNUSED(ev);
if(ev->button() == Qt::LeftButton)
{
emit clicked(); // 发射信号
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化