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. Ctrl + MouseWheelUp/Down Shortcut
Forum Update on Monday, May 27th 2025

Ctrl + MouseWheelUp/Down Shortcut

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 273 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.
  • thaiboydigitalT Offline
    thaiboydigitalT Offline
    thaiboydigital
    wrote on last edited by
    #1

    Hello , i need to connect some slot to (Ctrl+MouseWheelUp/Down) Event(shortcut) , didn't find anything helpful in stackoverflow/google -> So can you suggest smt ?

    aha_1980A 1 Reply Last reply
    0
    • thaiboydigitalT thaiboydigital

      Hello , i need to connect some slot to (Ctrl+MouseWheelUp/Down) Event(shortcut) , didn't find anything helpful in stackoverflow/google -> So can you suggest smt ?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @thaiboydigital,

      Add a virtual member function wheelEvent(QWheelEvent *e) to your Widget.

      Then use the following snippet:

      void Wigdet::wheelEvent(QWheelEvent *e)
      {
          if (e->modifiers() & Qt::ControlModifier) {
              // here you have Ctrl+MouseWheel
          }
      }
      

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      4

      • Login

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