Hi all,
I ported an application from Windows to MacOSX (10.6) and have some really undesirable behaviour.
There are about 10 widgets next to eachother and to highlight the current one, I use enterEvent and leaveEvent to change the color of the widget a bit.
The code is
void Widget
::enterEvent(QEvent* event
) {
setAutoFillBackground(true);
pal.
setColor(QPalette::Window, bgnd.
darker(125));
setPalette(pal);
}
void Widget
::leaveEvent(QEvent* event
) {
setAutoFillBackground(false);
setPalette(pal);
}
void Widget::enterEvent(QEvent* event)
{
setAutoFillBackground(true);
QPalette pal=palette();
QColor bgnd = pal.color(QPalette::Window);
pal.setColor(QPalette::Window, bgnd.darker(125));
setPalette(pal);
}
void Widget::leaveEvent(QEvent* event)
{
setAutoFillBackground(false);
QPalette pal=QApplication::palette();
setPalette(pal);
}
To copy to clipboard, switch view to plain text mode
On Windows and Linux, this works nice and smoothly. The color changes immediately follow the cursor.
On MacOSX, however, it takes about 500ms for the color to change after the cursor has entered the widget.
This means, that if the user moves with the cursor from the most left to the most right widget (10 in total), the color changes have about 5 seconds delay in total.
Any idea what might cause this?
Best regards,
Rainer
Bookmarks