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. [EVENT COMPRESSION 4.7.1 VS 5.3.0]
Forum Updated to NodeBB v4.3 + New Features

[EVENT COMPRESSION 4.7.1 VS 5.3.0]

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    avogad
    wrote on last edited by
    #1

    Hi,

    Seems like event compression has change between versions 4.7.1 and 5.3.0.

    I've implemented a basic widget that handles mouse move events and process some code in it.
    Here is a basic example of what it looks like. (no matter what the function does)

    @void MyLabel::mouseMoveEvent(QMouseEvent* /event/)
    {
    //do something long
    int k = 1;
    for(int i = 0; i < 100000000; ++i)
    {
    k = sqrt(k) + sqrt(k) + sqrt(k);
    }
    this->setText(QString::number(++_nb));
    }@

    The same code has been compiled using both version 4.7.1 and 5.3.0.

    Version 4.7.1 seems to properly compress events as the event is treated a few time while I click and move the mouse on the widget but 5.3.0 seems to treat every events so I have to wait to get any feedback.

    Is their an explanation to that change and is there a way to get a proper event compression?

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I remember reading some posts about the mouse event handling having changed but IIRC it was more about the handling of the clicked/double clicked events.

      Anyway, from a pure design point of view, having long operations taking place in a mouse event (or events in general) is not a good idea. Triggering a long operation from an event handler in a secondary thread is OK though

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        avogad
        wrote on last edited by
        #3

        Hi SGaist,

        Thanks for answering.

        The long operation was just an example to highlight the difference between both versions.

        The thing is that sometimes, one need to precisely track the mouse, like a drawing operation in a paint software, but sometimes the final result is the only thing needed, then avoiding in-between events is not an issue.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I see what you mean. To discuss difference of implementation between Qt 4 and Qt 5's event compression, you should contact the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - 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