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. Deactivating underlying items
QtWS25 Last Chance

Deactivating underlying items

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 689 Views
  • 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.
  • T Offline
    T Offline
    tech2nick
    wrote on last edited by
    #1

    Hi guys,

    I just wonder: is there a simple way to deactivate item containing many widgets, like buttons, text fields etc? I have two items (which are supposed to play the role of screens in my app). One is the main. When some button in item 1 is clicked, I want to move the other item OVER the first one, do what is needed, and then move it out. The problem is that the second item is partially opacious (intendedly), so not only I see the underlying widgets from item 1, but I can also use them (click, type something inside textField etc). Is there any way to deactivate the whole item 1, but to leave it visible? I want to see it through item 2, but I don't want the user to interact with it. Any ideas?

    Ps. I can paste some code here, but it contains only simple movement animations.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      peteritv
      wrote on last edited by peteritv
      #2

      Seems like a typical State-Transition problem to me...

      Your main application state = MAIN
      When ur button is clicked, you move to state = DO_SOMETHING

      On the transition from MAIN to DO_SOMETHING you can do anything you like with animations, such as opacity, visibility etc.

      See for an example: [https://www.youtube.com/watch?v=UDEhIqCBFE0](link url)
      And of course: Read the documentation about states and transitions :)

      I was looking for this link earlier, that impressed me how easy it is:
      youtube link

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tech2nick
        wrote on last edited by
        #3

        Thank you for your answer. I am aware of states and transitions (actually I use them a lot in that app). My question was: how to deactivate item, when something is above it, but that something doesnt overlap it tptally. After long struggle, I finally found an answer.

        It turned out, that items have property "enabled", which turns on and off any mouse and keyboard events. So to do what I need, I should add PropertyChanges{target: item1; enabled: true} in "main state" and respectly PropertyChanges{target: item1; enabled: false} in "do something state". Works pretty good:)

        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