hi,
i've got a problem with a QLabel. I want to receive a mousePressEvent only inside the label.
...
}
void MainWindow::mousePressEvent(QMouseEvent* event) {
...
}
To copy to clipboard, switch view to plain text mode
works fine, but
..
}
void imageLabel::mousePressEvent(QMouseEvent* event) {
..
}
To copy to clipboard, switch view to plain text mode
doesn't work and the compiler tells me that imageLabel was not declared. But i declared it with
imageLabel = new QLabel;
To copy to clipboard, switch view to plain text mode
and put
QLabel* imageLabel;
To copy to clipboard, switch view to plain text mode
in the public section of the header.
imageLabel should be able to receive mouseEvents, so am i using mousePressEvent in the wrong way or is there anything else i misunderstood
Bookmarks