QT判断鼠标是否在控件上

QT判断鼠标是否在控件上

// 判断鼠标是否在pushButton上
if (ui->pushButton->geometry().contains(this->mapFromGlobal(QCursor::pos())))
{
    
    
    // do something...
}

猜你喜欢

转载自blog.csdn.net/hwx802746/article/details/109244354
今日推荐