You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
671 B
C++

#include "mycheckbox.h"
//#include "mcc.h"
#include <QMouseEvent>
#include <QEvent>
#include <QApplication>
#include <QDebug>
#define cout qDebug() << "[" << __FILE__ <<":" << __LINE__ << "]"
MyCheckBox::MyCheckBox(QWidget *parent) : QCheckBox(parent) {
ptr = parent;
}
void MyCheckBox::mousePressEvent(QMouseEvent *e){
// QCheckBox::mousePressEvent(e);
Q_UNUSED(e);
}
void MyCheckBox::mouseReleaseEvent(QMouseEvent *e){
// QCheckBox::mouseReleaseEvent(e);
Q_UNUSED(e);
this->setChecked(!this->isChecked());
// 其他需要处理的函数
}
void MyCheckBox::mouseMoveEvent(QMouseEvent *e){
// QCheckBox::mouseMoveEvent(e);
Q_UNUSED(e);
}