QSlider Focus问题(MAC Leopard)带有Qapplication :: FocusChanged(Qwidget*,Qwidget*)
题
我在豹10.5.8中使用QT 4.6.0。我有一些滑块。每次我滑动/单击滑块时,它都会聚焦在Windows中。但是,它不会专注于Mac。我必须手动单击选项卡以更改焦点。如何纠正这一点?提前致谢!
解决方案
我只需要重新完成事件qwidget :: mousepressevent(qmouseevent * event):
void MyChildWidget::mousePressEvent ( QMouseEvent * event )
{
//event->accept();
this->setFocus(Qt::TabFocusReason);
event->ignore();
// give control to the parent
QSlider::mousePressEvent(event);
}
不隶属于 StackOverflow