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. If I want to switch between screens, do I also need to set `enabled` or is `visible` enough
Forum Updated to NodeBB v4.3 + New Features

If I want to switch between screens, do I also need to set `enabled` or is `visible` enough

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 366 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.
  • M Offline
    M Offline
    maxwell31
    wrote on last edited by
    #1

    Hi,

    I have a very basic question. I have a main.qml looking like this:

    ApplicationWindow {
      visible: true
      width: 1024
      height: 600
      Screen1 {
        id: screen1
        visible: true
      }
      Screen2 {
        id: screen2
        visible: false
      }
      Screen3 {
        id: screen3
        visible: false
      }
     ....
    

    The Screen objects fill the screen and represent what is visible on a touch screen in a given state of the application. There are buttons, which will switch between those screen. Is it enough, if these buttons only change the visible property of the Screens, or do I also need to set enable of the current screen to false when switching to a new screeen (in order to prevent the wrong screen to catch touch events)?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DavidM29
      wrote on last edited by DavidM29
      #2

      From what I've experienced, visible is enough. It will keep your screen state before you switch to an other screen but I never experienced any problem with touchscreen capture in the background.

      Edit :
      After a little bit of documentation I found this : visible
      "If this property is set to false, the item will no longer receive mouse events, but will continue to receive key events and will retain the keyboard focus if it has been set. (In contrast, setting the enabled property to false stops both mouse and keyboard events, and also removes focus from the item.)"

      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