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. how to disable pinch/zoom resizing of full screen browser?
Forum Updated to NodeBB v4.3 + New Features

how to disable pinch/zoom resizing of full screen browser?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 2.4k 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.
  • E Offline
    E Offline
    elkhunter
    wrote on last edited by p3c0
    #1

    How can I prevent pinch/zoom from resizing a fullscreen browser? I'd like to disable both operations so the browser always occupies the full screen (like a kiosk) and pinch/zoom only work within web pages that support them such as map sites. With the code below, a pinch temporarily scales the display then it returns to full screen and a zoom operation scales and stays that way. Any suggestions on how to prevent these operations?

    import QtQuick 2.0
    import QtWebKit 3.0
    import QtQuick.Controls 1.3
    import QtWebKit.experimental 1.0
    ApplicationWindow {
    visible: true
    visibility: "Maximized"
    WebView {
         anchors.fill: parent
         experimental.preferredMinimumContentsWidth: 800
         experimental.preferences.fullScreenEnabled: true
         experimental.preferences.developerExtrasEnabled: true
         url: "file:///path/to/index.html"
       }
    }
    
    p3c0P 1 Reply Last reply
    0
    • E elkhunter

      How can I prevent pinch/zoom from resizing a fullscreen browser? I'd like to disable both operations so the browser always occupies the full screen (like a kiosk) and pinch/zoom only work within web pages that support them such as map sites. With the code below, a pinch temporarily scales the display then it returns to full screen and a zoom operation scales and stays that way. Any suggestions on how to prevent these operations?

      import QtQuick 2.0
      import QtWebKit 3.0
      import QtQuick.Controls 1.3
      import QtWebKit.experimental 1.0
      ApplicationWindow {
      visible: true
      visibility: "Maximized"
      WebView {
           anchors.fill: parent
           experimental.preferredMinimumContentsWidth: 800
           experimental.preferences.fullScreenEnabled: true
           experimental.preferences.developerExtrasEnabled: true
           url: "file:///path/to/index.html"
         }
      }
      
      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @elkhunter,
      Since WebView uses Flickable you can use its interactive property. Try setting it to false.

      157

      1 Reply Last reply
      0
      • E Offline
        E Offline
        elkhunter
        wrote on last edited by
        #3

        Thanks, that fixed the issue.

        p3c0P 1 Reply Last reply
        0
        • E elkhunter

          Thanks, that fixed the issue.

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @elkhunter Glad to hear that :)
          You can mark the post as solved by editing the post title and prepending [Solved].

          157

          1 Reply Last reply
          0
          • E Offline
            E Offline
            elkhunter
            wrote on last edited by
            #5

            How do I edit the original post? I dont see that option listed anywhere on the page, just an option to reply.

            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