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. qt6 qt creator acceptTouchEvents on x11 ubuntu
Forum Updated to NodeBB v4.3 + New Features

qt6 qt creator acceptTouchEvents on x11 ubuntu

Scheduled Pinned Locked Moved Solved General and Desktop
19 Posts 4 Posters 1.9k 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.
  • gfxxG Offline
    gfxxG Offline
    gfxx
    wrote on last edited by gfxx
    #8

    https://rsadowski.de/posts/2023-01-05-qt-kde-controlling-debug-messages/

    bkt

    1 Reply Last reply
    0
    • gfxxG Offline
      gfxxG Offline
      gfxx
      wrote on last edited by gfxx
      #9

      I add these: if I try to play with cinammon desktop features for mouse event (less or more delay on clicck etc etc .... leave out touchpad control) touchscreen on qt6 give a little better result .... now seems click is bring when finger press exactly over text in a button .... but non when press on button ..... if try to make a 250px x 250px button with a button text at 24px .... if press on text all work as normal .... but if press on empty area of button no touch event ...... so these seeems related to a some sort of "z" level in xml file of button (or a similar situation on button file ( i suppose these, because not know if qt use xml for draw and render widget) not at secondary screen of touch or similar issue ....

      bkt

      1 Reply Last reply
      0
      • gfxxG Offline
        gfxxG Offline
        gfxx
        wrote on last edited by gfxx
        #10

        can these code solve problem?

        cmake_minimum_required(VERSION 3.16)
        project(MyTouchApp)
        
        # Find required Qt modules
        find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
        
        # Add the executable
        add_executable(MyTouchApp main.cpp MyWidget.cpp)
        
        # Link Qt libraries
        target_link_libraries(MyTouchApp PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets)
        
        # Optional: Add libinput
        find_package(PkgConfig REQUIRED)
        pkg_check_modules(LIBINPUT libinput)
        
        if(LIBINPUT_FOUND)
            target_include_directories(MyTouchApp PRIVATE ${LIBINPUT_INCLUDE_DIRS})
            target_link_libraries(MyTouchApp PRIVATE ${LIBINPUT_LIBRARIES})
        endif()
        
        # Optional: Add evdev
        pkg_check_modules(LIBEVDEV libevdev)
        
        if(LIBEVDEV_FOUND)
            target_include_directories(MyTouchApp PRIVATE ${LIBEVDEV_INCLUDE_DIRS})
            target_link_libraries(MyTouchApp PRIVATE ${LIBEVDEV_LIBRARIES})
        endif()
        

        bkt

        1 Reply Last reply
        0
        • gfxxG Offline
          gfxxG Offline
          gfxx
          wrote on last edited by
          #11

          the previous is only a part of solutions .... first need to connect qt6 to the right touch device .... on xinput list I find manu devices all generated from my touch ......

          bkt

          1 Reply Last reply
          0
          • gfxxG Offline
            gfxxG Offline
            gfxx
            wrote on last edited by
            #12

            but is not a solution .... I try to build on qt6 calculator example and touch work without any issue ..... so try to built a gui-test-project (perhaps without select any touch attribute ..... and set all as a desk app) with some button .... and on mainwindows touch work good ..... so no issue on touch and qt6. Problem is obviusly generated in some strange way from my app .... strange because using mouse click all work perfect on my app .... anly touch not work responsive (sometime if try to press a button ... nothing appens ... animation of button too .... but if use mouse all work everitime). .... my app have multiple page based on tab widget .... and sometime on bottom of one button there are an other invisible and disable ..... maybe these that generate these issue .... but need to investigate better ....

            bkt

            1 Reply Last reply
            0
            • gfxxG Offline
              gfxxG Offline
              gfxx
              wrote on last edited by
              #13

              I have a function that scan a long list of input and output (100 + 100 more or less) than change "state" of some widget on my gui .... that function work based on a timer start from gui with time of 100ms .... can be these that generate my problem? I think not because with mouse all work perfectly ...... my function work on qt5 perfectly with mouse or with touch .... only qt6 version have problem with touch ..... about these it may be that this further explanation could help someone come up with an idea that would help me solve the rather boring problem... I've been wasting my time on it for 2 months now.

              regards

              bkt

              jsulmJ 1 Reply Last reply
              0
              • gfxxG gfxx

                I have a function that scan a long list of input and output (100 + 100 more or less) than change "state" of some widget on my gui .... that function work based on a timer start from gui with time of 100ms .... can be these that generate my problem? I think not because with mouse all work perfectly ...... my function work on qt5 perfectly with mouse or with touch .... only qt6 version have problem with touch ..... about these it may be that this further explanation could help someone come up with an idea that would help me solve the rather boring problem... I've been wasting my time on it for 2 months now.

                regards

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #14

                @gfxx said in qt6 qt creator acceptTouchEvents on x11 ubuntu:

                I have a function that scan a long list of input and output (100 + 100 more or less) than change "state" of some widget on my gui ....

                How long does this function take to execute?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • gfxxG Offline
                  gfxxG Offline
                  gfxx
                  wrote on last edited by
                  #15

                  less than 50ms .....

                  bkt

                  1 Reply Last reply
                  0
                  • gfxxG Offline
                    gfxxG Offline
                    gfxx
                    wrote on last edited by
                    #16

                    I ran a whole series of tests (using a long test GUI in qt6 with a lot of command and launch from qtcreator GUI) and discovered that, in reality, Qt6 works well with mouse, keyboard, and touch in every condition.
                    Problem: my Qt6 application is launched by another program and acts as its GUI... ONLY in this case, the touch does not work properly.

                    Now, I tried creating a launch bash script where I write:
                    export QT_LOGGING_RULES="qt.qpa.input=true"
                    and then launch the application, which in turn opens the GUI in Qt6... In this case, the touch works fine.

                    Why? How can I include a command in my application to define this rule?

                    bkt

                    jsulmJ 1 Reply Last reply
                    0
                    • gfxxG gfxx

                      I ran a whole series of tests (using a long test GUI in qt6 with a lot of command and launch from qtcreator GUI) and discovered that, in reality, Qt6 works well with mouse, keyboard, and touch in every condition.
                      Problem: my Qt6 application is launched by another program and acts as its GUI... ONLY in this case, the touch does not work properly.

                      Now, I tried creating a launch bash script where I write:
                      export QT_LOGGING_RULES="qt.qpa.input=true"
                      and then launch the application, which in turn opens the GUI in Qt6... In this case, the touch works fine.

                      Why? How can I include a command in my application to define this rule?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #17

                      @gfxx Did you compare the environment (env variables) in case where it works and where it doesn't?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • Q Offline
                        Q Offline
                        QTCampoy
                        wrote on last edited by
                        #18

                        Any new on how to solve the problem

                        1 Reply Last reply
                        0
                        • gfxxG Offline
                          gfxxG Offline
                          gfxx
                          wrote on last edited by gfxx
                          #19

                          seems real solution is to obligate QT6 to use Xinput2 install by default on modern ubuntu/mint SO. For these you must use "qputenv" command in your main. The exact command can share more late ... not remember and not avaiable now.

                          ..... update ...

                          THE MAGIC ROW !!!!

                          qputenv("QT_XCB_NO_XI2", "0");  // Ensure Qt uses XInput2 for touch input
                          

                          bkt

                          1 Reply Last reply
                          0
                          • gfxxG gfxx has marked this topic as solved on

                          • Login

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