I am writing a Qt application for CentOS using Qt5.5.1.
void mouseReleaseEvent (QMouseEvent * event)
{
setCursor (Qt::ArrowCursor); //Reset to default arrow cursor.
}
void mousePressEvent (QMouseEvent * event)
{
setCursor (QCursor (QPixmap (":/Drag_and_Drop_bubble.png"))); //Customized cursor. This works well when set inside constructor (during initialization).
}
Requirement: I want the cursor to change on the press of the mouse left-click. The cursor should remain until mouse click is released. As soon as the mouse click is release, the cursor should be reset to default cursor.
Problem Statement: The cursor does not change on the click of mouse left button. It only changes after I release the left click [To verify this: I commented setCursor() function inside mouseReleaseEvent()]. Why does the cursor not change after mouse left-click and before click release? Any one encountered such issue?
Thank you for the help.