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. Best way to have a button stay on top at all times
Forum Updated to NodeBB v4.3 + New Features

Best way to have a button stay on top at all times

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

    Hello,

    I have a button that needs to be on the top of the UI at all times and if clicked take the click event before anyone else. So even if there is a popup, and I click on the button, I don't want the popup to be closed, instead I want this button to take the mouse event. However I don't want to change modal for the popup since I do want the popup to close if user clicks anywhere outside of the popup, except for this one button. How would you say is the easiest / cleanest way to achieve this?

    Thank you

    ndiasN 1 Reply Last reply
    0
    • P Puya

      Hello,

      I have a button that needs to be on the top of the UI at all times and if clicked take the click event before anyone else. So even if there is a popup, and I click on the button, I don't want the popup to be closed, instead I want this button to take the mouse event. However I don't want to change modal for the popup since I do want the popup to close if user clicks anywhere outside of the popup, except for this one button. How would you say is the easiest / cleanest way to achieve this?

      Thank you

      ndiasN Offline
      ndiasN Offline
      ndias
      wrote on last edited by
      #2

      Hi @Puya

      You can try to set the button z-property to a large value (e.g. 1000) if elements belongs to the same item: https://doc.qt.io/qt-6/qml-qtquick-item.html#z-prop

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Puya
        wrote on last edited by
        #3

        @ndias I don't think z value can help when it comes to Popup.

        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