getting no response from QWheelEvent
-
I am trying to use the mouse wheel but it does not give any response.
i tried with the function below:
void wheelEvent(QWheelEvent *ev)
{
if(ev->angleDelta().y() > 0) // up Wheel
cout<< " increasing" << endl;
else if(ev->angleDelta().y() < 0) //down Wheel
cout<< " decreasing" << endl;
}
how to solve this problem?@Md-Saif-Khan said in getting no response from QWheelEvent:
void wheelEvent(QWheelEvent *ev)
You don't use this function in your qtopenglwidget here ...
-
@Md-Saif-Khan said in getting no response from QWheelEvent:
void wheelEvent(QWheelEvent *ev)
You don't use this function in your qtopenglwidget here ...
@Christian-Ehrlicher could you please tell me how i can use mouse wheel while i am working on qtopenglwidget?
-
Hi,
You start by creating a subclass of QOpenGLWidget.
-
@SGaist what did you mean by "creating a subclass of QOpenGLWidget". Could you please provide me some link or example which i can follow.?
-
Then I recommend with starting from the basics: C++ inheritance.
-
Then I recommend with starting from the basics: C++ inheritance.
@SGaist Sorry. I meant that it would be helpful if you can provide me some website link where i can understand how they are using mouse wheel in qt for qtopenglwidget.
-
@SGaist Sorry. I meant that it would be helpful if you can provide me some website link where i can understand how they are using mouse wheel in qt for qtopenglwidget.
@Md-Saif-Khan said in getting no response from QWheelEvent:
me some website link where i can understand how they are using mouse wheel in qt for qtopenglwidget.
This will not help until you learn basic ++ stuff like inheritance as @SGaist already pointed out.
-
You know that your current free function just misses one thing to be properly used ?
-
I understood the problem. Thank you for your help. :)
-
Great !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three doted menu beside the answer you deem correct so that other forum users may know a solution was found :-)