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. Does QEvent work on Windows 10 x64 with touchpad
Qt 6.11 is out! See what's new in the release blog

Does QEvent work on Windows 10 x64 with touchpad

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 605 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
    Sergey Vasilenko
    wrote on last edited by
    #1

    Hello everyone ,

    I’m writing windows application which allow user to change a size and position of the specific area by using notebook touchpad. For this purpose I used QEvent Class. But this can identify only a scroll gesture (QEvent::Type::Wheel), as to other gestures - there is no reaction. I created a simple app by using examples but got the same result

    What am I doing wrong?

    Here is a code of my simple app

    #include "mainwindow.h"
    #include <QApplication>
    
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent)
    {
        if(QCoreApplication::testAttribute(Qt::AA_DontCreateNativeWidgetSiblings)==false)
            setAttribute(Qt::WA_NativeWindow);
        setAttribute(Qt::WA_AcceptTouchEvents, true);
    
        setMinimumSize(640, 480);
        m_label = new QLabel("No Events Before", this);
        m_label->setFont(QFont("Arial", 24));
        m_label->setAlignment(Qt::AlignCenter);
        m_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
        setCentralWidget(m_label);
        installEventFilter(this);
    }
    
    bool MainWindow::eventFilter(QObject *, QEvent *event)
    {
        QString msg;
        switch (event->type())
        {
        case QEvent::TouchBegin:
            msg = "TouchBegin";
            break;
        case QEvent::TouchUpdate:
            msg = "TouchUpdate";
            break;
        case QEvent::TouchEnd:
            msg = "TouchEnd";
            break;
        case QEvent::Gesture:
            msg = "Gesture";
            break;
        case QEvent::Type::Wheel:
            msg = "Wheel";
            break;
        case QEvent::Type::GestureOverride:
            msg = "GestureOverride";
            break;
        }
        if (!msg.isEmpty())
            m_label->setText(msg + "Event");
        return false;
    }
    

    project structure

    Qt5Core.dll
    Qt5Gui.dll
    Qt5Widgets.dll
    app.exe
    platforms/qwindows.dll
    

    Environment:
    Qt 5.6.2 64bit
    Windows7 and10 64bit
    compiler VC2015 CE 64bit

    Touchpad drivers are installed and native windows applications responds to gestures

    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