Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Events not called unless mouse is moving

Events not called unless mouse is moving

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 3 Posters 3.1k 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.
  • P Offline
    P Offline
    petejames
    wrote on last edited by
    #1

    I have a problem where it appears that events generated by QTimer and QExtSerialPort don't get called unless the mouse moves. It is as though the event loop isn't running unless being fed with mouse move events.

    The application structure is as follows. There is a main application derived from QApplication and a main window derived from QMainWindow all in the usual way. There are also widgets e.g. graphWidget which show data graphically which are derived from a fooWidget class which itself is derived from QWidget. In, for example, graphWidget I have a QTimer which updates the graph at a regular interval. The problem is the graph doesn't get updated unless I keep moving the mouse. I.e. the event slot that the QTimer is connected to, isn't executed unless the mouse is moving.

    The same is true for the communications class gathering data from the serial port using QExtSerialPort. There is a barWidget class derived from QWidget and a serialComms class derived from barWidget, in the serialComms class there is QExtSerialPort getting data from the serial port but its events slot which is connected to the ReadyRead() signal is also not called unless the mouse is moving.

    All the above classes are constructed using 'this' from the mainWindow class. To get the events to be called, the mouse needs to be moving above the Qt application, if the mouse is moving anywhere else on the desktop the events don't get called.

    Has anyone seen this before? Can you shed any light on it please?

    Regards
    Pete

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Hi petejames,

      Welcome to the forum.

      It is a little difficult to picture what you have coded. It seems already quite complex. Can you post a small compilable example showing your problem?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        petejames
        wrote on last edited by
        #3

        Thank you,

        It's a bit difficult to since the application is a reasonable size running at about 50,000 lines of code at the moment and I'm probably only half way there.

        I did write a quick application based on QDialog to test the QExtSerialPort class with just a QLineEdit for the bytes to transmit, a QPushButton to send the bytes and a QTextBrowser to display the bytes received. It all worked perfectly, so I can't generate the problem outside of the main application.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          Events not being handled properly sounds like an event-loop-reentry problem. Do you call exec() on dialogs or QApplication::processEvents() somewhere?

          If you can anything that displays this issue, please submit it. It is very hard for us to help you without any code we can read or (even better) try.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          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