Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ComboBox - disable mouse wheel scrolling
Forum Updated to NodeBB v4.3 + New Features

ComboBox - disable mouse wheel scrolling

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 3.4k 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.
  • S Offline
    S Offline
    supaiku_
    wrote on last edited by
    #1

    Hi,

    how can I prevent the mouse wheel to change the currentitem of a ComboBox?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      supaiku_
      wrote on last edited by
      #2

      Nobody has an idea?

      1 Reply Last reply
      0
      • C Offline
        C Offline
        charango
        wrote on last edited by
        #3

        Install event filter for the combobox. And "eat" event in event handler:

        ui->comboBox->installEventFilter(this);
        ...
        bool myForm::eventFilter(QObject *o, QEvent *ev)
        {
            if (o == ui->comboBox && ev->type() == QEvent::Wheel)
            {
                    return true;
            }
            return QObject::eventFilter(o, ev);
        }
        
        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