Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. QPushButton touchscreen problem
Forum Updated to NodeBB v4.3 + New Features

QPushButton touchscreen problem

Scheduled Pinned Locked Moved Solved QtonPi
3 Posts 2 Posters 3.1k 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.
  • D Offline
    D Offline
    davidino
    wrote on last edited by
    #1

    Goodmorning to all,
    I'm trying to create a GUI program using QTcreator. I've bought a Waveshare 3.5 display and I started making some widgets.
    I've got a problem with the touchscreen. If I connect a mouse everything is fine and I received signals on my slot functions:

    void MainWindow::on_pushButton_clicked()
    {
    qDebug("button pressed");
    }

    void MainWindow::on_pushButton_released()
    {
    qDebug("button release");
    }

    But if I use touchscreen, instead, QPushButtons slots aren't called and the drawing doesn't get updated. However I can see that events:

    void MainWindow::mousePressEvent(QMouseEvent *event)
    void MainWindow::mouseMoveEvent(QMouseEvent *event)
    void MainWindow::mouseReleaseEvent(QMouseEvent *event)

    are called correctly. Moreover if I create a QDial widget, the touchscreen works as with mouse.
    Looking in the internet, some people had a similar problem that has been resolved calling setAttribute(Qt::WA_AcceptTouchEvents, false); but for me it doesn't work.

    Can you help me?
    Thank you in advanced.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Please provide more information about your hardware/software setup.

      What version of Qt ?
      What OS are you running ?
      If Linux, what distribution ?
      What input driver are you using ?
      What device are you running on ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Please provide more information about your hardware/software setup.

        What version of Qt ?
        What OS are you running ?
        If Linux, what distribution ?
        What input driver are you using ?
        What device are you running on ?

        D Offline
        D Offline
        davidino
        wrote on last edited by
        #3

        @SGaist Hello SGaist,
        thank you very much for your answer. I've build an OS image and sdk with yocto poky-morty so that I could cross compile my applications for a Raspberrypi3.
        Qt version is 5.7.1.
        I feel a little silly but I found out what was wrong.
        Basically my touch was rotated of 180 compare to my screen. So when I pressed on QDial, which is in the middle of the screen, it worked while when I pressed a button on the corner the clicked() release() could not be launched. Thank you anyway.

        P.S. I've got another problem with libmodus, opened in another thread, could you look at it :) ?

        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