[Qt-interest] QWidget::enterEvent and QWidget::leaveEvent

Samuel Baxter samuel857 at gmail.com
Mon Jun 1 07:13:33 CEST 2009


Apologies for the wasted bandwidth. Once the mouse exits the widget,
tracking the mouse move events does not update(). They need to be
inserted in the enter/leave handlers.

    void enterEvent(QEvent *) {
        mouse_is_inside = true;
        update();
    }
    void leaveEvent(QEvent *) {
        mouse_is_inside = false;
        update();
    }

Cheers,
Samuel



More information about the Qt-interest-old mailing list