I googled around and found this forum thread in which the OP seems to have had the exact problem I am having. The question is, how would I inherit from QLabel a
QLabel
just like this :D
void CustomLabel::mousePressEvent(QMouseEvent *ev) { QString x = QString::number(ev->x()); QString y = QString::number(ev->y()); qDebug() << x << "," << y; }