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. Problem with horizontal wheelEvent
Forum Updated to NodeBB v4.3 + New Features

Problem with horizontal wheelEvent

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 4.7k 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.
  • S Offline
    S Offline
    Sheenmue
    wrote on last edited by
    #1

    I have implemented wheelEvent method in a QMainWindow class and when there's a vertical wheelEvent it's being called correctly, but when the wheelEvent is horizontal it's never called. I'm using a laptop and when there's a wheelEvent it's horizontal or vertical I can see how the mouse cursor icon changes so I'm sure there's a wheelEvent, but the method is never called when it's horizontal.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dakron
      wrote on last edited by
      #2

      Hi Sheenmue,

      The wheelEvent is called in both cases. You can check that by using e.g. qDebug () and QWheelEvent::orientation() inside wheelEvent method.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sheenmue
        wrote on last edited by
        #3

        I'm already checking it, but nothing happens. This is the code:

        @void MainWindow::wheelEvent(QWheelEvent event){
        qDebug() << "WheelEvent";
        int mouseDegrees = -1
        event->delta()/8;
        if(event->orientation() == Qt::Horizontal){
        int canal = (currentY+event->pos().y()-HEADER)/(CHANNEL_MARGIN+CHANNEL_TOP+ITEM_MARGIN+ITEM_H+CHANNEL_BOTTOM);
        qDebug() << "Canal " << canal;
        if(canal<channels->count() && canal >= 0){
        channels->at(canal)->finalX += mouseDegrees4;
        if(!timer->isActive()){
        timer->start(TIMER);
        }
        }
        }else{
        finalY += mouseDegrees
        4;
        if(!timer->isActive()){
        timer->start(TIMER);
        }
        }
        }@

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dakron
          wrote on last edited by
          #4

          This is not a matter of wheelEvent code but how do you try to call it. Do you have any widgets (children) on top of MainWindow ? Do you really scroll horizontally ? How ?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sheenmue
            wrote on last edited by
            #5

            As I said I simply implemented the method in a class that inherits from QMainWindow. Some widgets are shown sometimes and when they are wheelEvent is never called (horizontal nor vertical), but that's normal. The problem is just that horizontal wheel events are never detected and as I said I know I'm making them correctly because the mouse cursor icon changes in my laptop and it works with web browsers.

            I have uploaded the program in its current state. If somebody wants to try it to see if it's a problem with my laptop it can be downloaded from "here":http://www.fallenleafsoft.com/Horus.rar . It hasn't install files or anything else, just run Horus.exe and if you want to delete it simply delete the folder, it should run in Windows. The app is an rss reader.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dakron
              wrote on last edited by
              #6

              Could you put here the simple example that reproduces you problem ?
              I tried on my workstation with the simple example and it works fine.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Sheenmue
                wrote on last edited by
                #7

                I received a new iMac, tried the program compiled for both Windows 7 and Mac OS X Lion and it worked perfectly with the magic mouse so it was a problem with my laptop, for some reason it doesn't work with its touchpad even if horizontal scroll works with other programs. If somebody experiences the same problem it's an Acer Aspire with a Synaptics touchpad.

                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