这里是手动添加以QLabel为基类c++类,重载mouseDoubleClickEvent()nlabel.h
#ifndef NLABEL_H
#define NLABEL_H
#include
class nLabel : public QLabel
{
public:
explicit nLabel(QWidget *parent = 0);
~nLabel();
public:
void mouseDoubleClickEvent(QMouseEvent *);
};
#endif // NLABEL_Hnlabel.cpp
#include "nlabel.h"
#include
nLabel::nLabel(QWidget *parent):
QLabel(parent)
{
}
nLabel::~nLabel()
{
}
void nLabel::mouseDoubleClickEvent(QMouseEvent *)
{
QStringList fileNameList;
QString fileName0;
QFileDialog* fd &#