Wow,
first of all QWidget::setMouseTracking() is not needed. It is just for getting mouse move events which you aren't need. Then to use a QTimer is overkill because of all the signal and slots thing. Better use a simple QTime::currentTime (). Save the time stamp in press function and in the release function you just calculate the difference and if it is greater then 4 seconds emit a signal.
Lykurg
Bookmarks