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 check if a item is currently visible on screen?
QtWS25 Last Chance

How to check if a item is currently visible on screen?

Scheduled Pinned Locked Moved QML and Qt Quick
visibilityitem
5 Posts 2 Posters 6.7k 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.
  • F Offline
    F Offline
    Frime
    wrote on 11 May 2015, 09:55 last edited by
    #1

    Hi together!

    Does anybody have a good (read: "performant") solution for this issue?
    I have a set of controls which have bindings to frequently changing data values. The data comes from a limited hardware-bus. Therefore, it would be better to disable the binding* while the control is not visible on screen. Items "visible"-property doesn't help in this case. So, how to determine if a Item-based QML widget is currently visible on screen (and not hidden by an overlay or currently outside the visible area)?

    (*The data is delivered by a c++ written stub object which has a "pause" function.)

    Thanks in advance!
    Frime

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jean
      wrote on 12 May 2015, 02:04 last edited by
      #2

      What do you mean the contorl is not visible on screen?
      Is it to turn screen off or to display other UI page(qml) or to context swiching the other application and so on?
      You need to imply more detail.

      F 1 Reply Last reply 12 May 2015, 08:32
      0
      • J Jean
        12 May 2015, 02:04

        What do you mean the contorl is not visible on screen?
        Is it to turn screen off or to display other UI page(qml) or to context swiching the other application and so on?
        You need to imply more detail.

        F Offline
        F Offline
        Frime
        wrote on 12 May 2015, 08:32 last edited by
        #3

        Hi @Jean,

        Thank you very much for your response! So, the best solution for me would be if it doesn't matter why the control is not visible on screen. The only thing I'm interested in is if a "living" instance is currently rendered or not. Other approaches, eg. checking if current surrounding page is actually displayed or checking x|y coordinates against the viewport are too expensive (too much bindings necessary).

        Any idea? Thanks in advance!
        Frime

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jean
          wrote on 12 May 2015, 15:43 last edited by
          #4

          Hi @Frime

          It is very important to design UI scenario because UI operates event-driven as you know.
          You want to efficiently collect some data from limited hardware-bus.
          And I think it is necessary to display data on one page or few number page, is it right?

          if yes or not, you know some condition (occur events or singals) to enter or exit the page.
          You can call to stop function(data collection) when the exit condition is satisfied.

          Jean.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Frime
            wrote on 13 May 2015, 10:00 last edited by
            #5

            Hi @Jean,

            yes, you're right. But in my case this is unfortunately not possible. What I am doing is developing a Toolkit with a bunch of Controls for displaying data. These controls are not used by me (even not used by really developers) but used by people who are configuring the UI pages via drag and drop in the Quick Designer. This is why the logic should be encapsulated within the control...

            Thanks again!

            Cheers,
            Frime

            1 Reply Last reply
            0

            1/5

            11 May 2015, 09:55

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved