How to get the mouse event from the QCameraViewfinder?
-
Now I put the QCameraViewfinder on an QWidget named container.
I rewrote the mouseEvent of the container QWidget.Because of the QCameraViewfinder object on the container,the container couldnt get the mouse event from the user.So how to fixed the problem?
I rewrote the eventfiler of the QCameraViewfinder .But it seemed dosent work. -
Now I put the QCameraViewfinder on an QWidget named container.
I rewrote the mouseEvent of the container QWidget.Because of the QCameraViewfinder object on the container,the container couldnt get the mouse event from the user.So how to fixed the problem?
I rewrote the eventfiler of the QCameraViewfinder .But it seemed dosent work.@nicker-player You need to subclass QCameraViewfinder and override the event there, not in the container widget.
-
@nicker-player You need to subclass QCameraViewfinder and override the event there, not in the container widget.
-
@nicker-player said in How to get the mouse event from the QCameraViewfinder?:
and dose the qserialport support writting data in the non ui thread or sub thread ?
Yes, it does. But usually there is no need for a thread and you should avoid that. Why do you think you need a thread?
"And I rewrote the event of the mouseevent and set the slot with queueconnection" - an event is not a signal, so I don't know what you mean here. Please show your code and explain better what the problem is now ("still have a delayed time for the mouse" - what does this mean exactly?).
-
@nicker-player said in How to get the mouse event from the QCameraViewfinder?:
and dose the qserialport support writting data in the non ui thread or sub thread ?
Yes, it does. But usually there is no need for a thread and you should avoid that. Why do you think you need a thread?
"And I rewrote the event of the mouseevent and set the slot with queueconnection" - an event is not a signal, so I don't know what you mean here. Please show your code and explain better what the problem is now ("still have a delayed time for the mouse" - what does this mean exactly?).
@jsulm
I made a program that control the other keyboard with the qserialport method.When I moved the mouse ,the mouse event get the data and send to the keboard hardware(which is a chipset in fact).But only when i stopped moving the mouse,the mouse event then emit the signal to the keyboard chipset.and if I move faster ,so there would be a delayed time for the signals. -
@jsulm
I made a program that control the other keyboard with the qserialport method.When I moved the mouse ,the mouse event get the data and send to the keboard hardware(which is a chipset in fact).But only when i stopped moving the mouse,the mouse event then emit the signal to the keyboard chipset.and if I move faster ,so there would be a delayed time for the signals.@nicker-player This is not a problem with threads.
What exact mouse event do you use to send data?
Sharing your code can also help to find the issue.