void hidePopup()
{
QAbstractItemView *pItemView = this->view();
int ItemViewY = pItemView->height();
int height = this->height();
// 鼠标在控件上坐标Y位置
int curY = QCursor::pos().y() - mapToGlobal(geometry().topLeft()).y() + geometry().y();
// 鼠标在控件上坐标X位置
int curX = QCursor::pos().x() - mapToGlobal(geometry().topLeft()).x() + geometry().x();
int ItemViewX = pItemView->width();
int Width = this->width();
// 光标位置超过可点击的范围,隐藏comboBox的下拉框
if(icurY < height || curY > ItemViewY+iheight || curX<0 || curX > iItemViewX)
{
QComboBox::hidePopup();
}
}