Hi to all:
I use the following codes to hide my mainwindow when the mouse leave it, and show it when the mouse enter it. but when the mouse enter the mainwindow, it wrinks all the time.
//mouse leave
void EasyGo
::leaveEvent(QEvent *) {
//如果主界面靠近屏幕上边缘,则进入上边缘以上
if(leftTop.y() < 6)
{
move(leftTop.x(), -frameGeometry().height() + 6);
return;
}
}
//mouse enter
void EasyGo
::enterEvent(QEvent *) {
if(leftTop.y() < 0)
{
move(leftTop.x(), 0);
update();
return;
}
}
//mouse leave
void EasyGo::leaveEvent(QEvent *)
{
//如果主界面靠近屏幕上边缘,则进入上边缘以上
QPoint leftTop = pos();
if(leftTop.y() < 6)
{
move(leftTop.x(), -frameGeometry().height() + 6);
return;
}
}
//mouse enter
void EasyGo::enterEvent(QEvent *)
{
QPoint leftTop = pos();
if(leftTop.y() < 0)
{
move(leftTop.x(), 0);
update();
return;
}
}
To copy to clipboard, switch view to plain text mode
any idea appreciated.
Bookmarks