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. QWheelEvent & Siblings/Children
Forum Updated to NodeBB v4.3 + New Features

QWheelEvent & Siblings/Children

Scheduled Pinned Locked Moved Solved General and Desktop
qwheeleventqwidget
3 Posts 2 Posters 934 Views 2 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.
  • J.HilkJ Offline
    J.HilkJ Offline
    J.Hilk
    Moderators
    wrote on last edited by
    #1

    Hi,

    Does anyone know of an easy way to forward a QWheelEvent to a sibling or one specific child?

    Currently I do this with a signal that has the QWheelEvent* as argument. But QWheelevent itself is protected, so I'll have to subclass the target Widget as well (a QDoubleSpinbox in this case) to create a public slot that forwards the QWheelEvent.

    This seems like a rather hackish way to do this.


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    raven-worxR 1 Reply Last reply
    0
    • J.HilkJ J.Hilk

      Hi,

      Does anyone know of an easy way to forward a QWheelEvent to a sibling or one specific child?

      Currently I do this with a signal that has the QWheelEvent* as argument. But QWheelevent itself is protected, so I'll have to subclass the target Widget as well (a QDoubleSpinbox in this case) to create a public slot that forwards the QWheelEvent.

      This seems like a rather hackish way to do this.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @J.Hilk said in QWheelEvent & Siblings/Children:

      Currently I do this with a signal that has the QWheelEvent* as argument

      why not directly forward the event to the child widget instead?
      (using QCoreApplication::sendEvent())

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      J.HilkJ 1 Reply Last reply
      3
      • raven-worxR raven-worx

        @J.Hilk said in QWheelEvent & Siblings/Children:

        Currently I do this with a signal that has the QWheelEvent* as argument

        why not directly forward the event to the child widget instead?
        (using QCoreApplication::sendEvent())

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by J.Hilk
        #3

        @raven-worx said in QWheelEvent & Siblings/Children:

        @J.Hilk said in QWheelEvent & Siblings/Children:

        Currently I do this with a signal that has the QWheelEvent* as argument

        why not directly forward the event to the child widget instead?
        (using QCoreApplication::sendEvent())

        Well, yes, that seems exactly like the proper way to do it!
        I'll look further into it, thanks!


        Yes this is exactly what I was looking for. Solved!


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        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