Details
-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
5.6.2, 6.2.0 FF
-
None
-
Mac OS X.11
Description
On the mac, a window which is not the current active window does not get any cursor when the mouse is over : it gets only the basic arrow cursor, event though its current cursor is different.
Also, calling QApplication::setOverrideCursor(**a cursor** ) from an event handler of an inactive window (e.g. in enterEvent()) does nothing.
Sample code attached, and copied below.
#include <QApplication>
#include <QMainWindow>
// On the mac, qt5.6, only the currently active window gets the appropriate cursor.
// Un-activated window only display the arrow cursor.
// Note that even QApplication::setOverrideCursor(cursor()); fails displaying the correct cursor
// when entering an unactive window
class MainWindow : public QMainWindow
{
//Q_OBJECT
protected:
void enterEvent(QEvent * _e)
void leaveEvent(QEvent * _event)
{ QApplication::restoreOverrideCursor(); }};
int main(int argc, char *argv[])
{ QApplication app(argc, argv); QMainWindow mainWin1; mainWin1.setWindowTitle("win1"); MainWindow mainWin2; mainWin2.setWindowTitle("win2"); mainWin1.setCursor(Qt::SizeAllCursor); mainWin1.setWindowTitle("win1"); mainWin2.setCursor(Qt::OpenHandCursor); mainWin1.show(); mainWin2.show(); mainWin1.activateWindow(); return app.exec(); }