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. able to touch on disabled background when popup is up.

able to touch on disabled background when popup is up.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 3 Posters 1.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.
  • A Offline
    A Offline
    AYYAPPA
    wrote on last edited by
    #1

    hi all,

    in our project when a popup displayed on screen we disable background which doesn't receive any touch/mouse click events.

    but when i press mouse and touch same time very fast, many times in disabled background, suddenly it receives mouse and touch events.

    please let me know why this is happening.

    thanks ,
    ayyappa.

    raven-worxR 1 Reply Last reply
    0
    • A AYYAPPA

      hi all,

      in our project when a popup displayed on screen we disable background which doesn't receive any touch/mouse click events.

      but when i press mouse and touch same time very fast, many times in disabled background, suddenly it receives mouse and touch events.

      please let me know why this is happening.

      thanks ,
      ayyappa.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @AYYAPPA said in able to touch on disabled background when popup is up.:

      please let me know why this is happening.

      from whom do you expect an answer here?!
      Your post barely gives more information than "i have a problem".

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AYYAPPA
        wrote on last edited by
        #3

        @raven-worx i am sorry about that, i couldn't attach project work here. now i created on paint image with description . hope this helps.

        0_1544017204270_0ec4bde0-3705-4edb-ad9d-92e6f2730185-image.png

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          @AYYAPPA can you help with simple example which shows the behaviour. You can create simple project with three objects like the above. This helps us to check & revert. Please note that issue could be from QML or your project logic. To identify the issue, simple workable code with your issue will help.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AYYAPPA
            wrote on last edited by
            #5

            Rectangle {
            id: mainWindow

            width: 1920
            height: 1080
            

            enabled: !(dialogue1.visible || dialogue2.visible)
            MouseArea{
            id: m1

                enabled: parent.enabled
                anchors{
                    left: parent.left
                    right: parent.verticalCenter
                    top: parent.top
                    bottom: parent.bottom
                }
                 
                //display function displays dialogue in center and disables background
                //dialogue 1 dimensions 1000x700
                onClicked: display(dialogue1)
                
            }
            
            MouseArea{
                id: m2
            
                enabled: parent.enabled
                anchors{
                    left: parent.verticalCenter
                    right: parent.right
                    top: parent.top
                    bottom: parent.bottom
                }
                //display function displays dialogue in center and disables background
                //dialogue 1 dimensions 1000x700
                onClicked: display(dialogue2)
            }
            

            }

            in above code when we click left half of mainWindow dialogue 1 is displayed, or if we click right half of mainWindow dialogue 2 is displayed.
            now open any one dialogue, as its dimesnions are almost half of mainWindow, we see can see some part of mainWindow around displayed dialogue. in code we disable maninWindow if any dialogue is on screen, and mouse areas m1 and m2 enabled related to mainWindow enabled , they will also be disabled. so clicking in seen portion of mainWIndow when any dialogue is on screen will not display any dialogue as mouse areas are disabled. . now if we click with mouse and touch with finger simultaneously and repeatedly in disabled m1 or m2 , after some time they will receive the click event and respective dialogue will be displayed.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AYYAPPA
              wrote on last edited by AYYAPPA
              #6

              i was able to resolve issue, with the use of multipointtoucharea treating mouse click as single touch event and setting minimum and maximum touch points to zero to discard all mouse and touch events in disabled background.

              i used this piece of code in place of mouse area:
              MultiPointTouchArea{
              id: clickCatcher
              anchors.fill: parent
              mouseEnabled: true
              minimumTouchPoints: 1
              maximumTouchPoints: 1
              }

              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