Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get the mouse event from the QCameraViewfinder?

How to get the mouse event from the QCameraViewfinder?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 328 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote on last edited by
    #1

    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.

    jsulmJ 1 Reply Last reply
    0
    • nicker playerN nicker player

      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.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @nicker-player You need to subclass QCameraViewfinder and override the event there, not in the container widget.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      nicker playerN 1 Reply Last reply
      0
      • jsulmJ jsulm

        @nicker-player You need to subclass QCameraViewfinder and override the event there, not in the container widget.

        nicker playerN Offline
        nicker playerN Offline
        nicker player
        wrote on last edited by nicker player
        #3

        @jsulm
        And I rewrote the event of the mouseevent and set the slot with queueconnection.but the there's still have a delayed time for the mouse cursor.It is hard for me to figure out a way to make it faster.

        and dose the qserialport support writting data in the non ui thread or sub thread ?

        jsulmJ 1 Reply Last reply
        0
        • nicker playerN nicker player

          @jsulm
          And I rewrote the event of the mouseevent and set the slot with queueconnection.but the there's still have a delayed time for the mouse cursor.It is hard for me to figure out a way to make it faster.

          and dose the qserialport support writting data in the non ui thread or sub thread ?

          jsulmJ Online
          jsulmJ Online
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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?).

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          nicker playerN 1 Reply Last reply
          1
          • jsulmJ jsulm

            @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 playerN Offline
            nicker playerN Offline
            nicker player
            wrote on last edited by
            #5

            @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.

            jsulmJ 1 Reply Last reply
            0
            • nicker playerN nicker player

              @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.

              jsulmJ Online
              jsulmJ Online
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved