Reputation: 131
I need a hover event on label when I move mouse over label to change a mouse pointer.
I tried something like this:
void MainWindow::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
if(event->GraphicsSceneHoverEnter){
QCursor car;
car.setShape(Qt::PointingHandCursor);
ui->label_no->setCursor(car);
}
}
Upvotes: 0
Views: 354
Reputation: 18504
You need only this code in MainWindow constructor.
QCursor crs(Qt::PointingHandCursor);
ui->label_no->setCursor(crs);
Upvotes: 2