Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set a default cursor for an application

Tags:

c++

qt

In a Qt application, is there an equivalent to QApplication::setFont that sets the applications default cursor, to be overwritten by setting one on a specific widget?

QApplication::setOverrideCursor overrides all widget specific ones, I want local ones to take precidene over this one, but still use my cursor if I didn't specify one.

like image 723
Jon Avatar asked May 12 '26 10:05

Jon


1 Answers

A QWidget either uses the cursor specified with QWidget::setCursor or falls-back it's parents' cursor setting. So, simply setting the cursor for your main windows should do the trick.

New top level windows and dialogs will need to have the cursor set when created since their is no parent from which to inherit.

like image 75
Judge Maygarden Avatar answered May 14 '26 23:05

Judge Maygarden