Home > Mobile >  Qt event filter is invalid,
Qt event filter is invalid,

Time:09-26


I want to make the scroll bar can't scroll, such an event filter is added, but no, even if direct return true have no filter, can still scroll, not too understand, novice, do not know whether have great god tell scrollAreaWidgetContents is the inside of the scroller controls,
Bool MainWindow: : eventfilters (QObject * obj, QEvent * ev)
{
If (obj==UI - & gt; ScrollAreaWidgetContents)
{
If (QEvent: : Wheel==ev - & gt; The type ())
{
QWheelEvent * WE=dynamic_cast & lt; QWheelEvent * & gt; (ev);
return true;
If (WE - & gt; Delta () & gt; 0)
{

}
The else
{
Return QWidget: : eventfilters (obj, ev);
}
}
}
The else
{
Return QWidget: : eventfilters (obj, ev);
}
}

CodePudding user response:

Does not add the function of the scroll bar controls should be directly, without a rewrite the class and method

CodePudding user response:

reference 1/f, to be continued _1006 response:
control should have the function of direct don't add the scroll bar, if you don't have a rewrite the class is also a way to
later thought that control the size of the scroller should be ok, but this phenomenon is so strange,
  •  Tags:  
  • Qt