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 delete/remove screen/page from the display?
Forum Updated to NodeBB v4.3 + New Features

How to delete/remove screen/page from the display?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.8k 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.
  • A Offline
    A Offline
    at_pradeep
    wrote on last edited by
    #1

    I have one Loader using which i am loading the multiple screen/pages.

    I have around 10 QML screen/pages which i am loading in the loader one by one on mouse events.

    On some of the screens i need to set transparency using "QWidget::setMask()" function to make some part of the screen/page make transparent.

    I am doing set mask from CPP code using "QWidget::setMask()" on the rootObject, which is Loader screen.

    QWidget::setMask is working perfectly, but masked area displays previously loaded screen/page.

    So i have the question, Is Loader Element properly deletes/removes the loaded component from the display before loading the new screen/page in the Loader, as mentioned in documents "http://doc.qt.nokia.com/4.7-snapshot/qml-loader.html":here.

    Also there are two function named "Component.onDestroyed:" and "Component.onDestruction:"
    When i Load new screen/page in the Loader "onDestruction" event is getting fired for the Loaded screen.

    What i want is, I want to completely remove/destroy the screen/page from the display once we load new page in the loader.
    I have also tried to set the visibility and opacity of the previously loaded screen, but still i am able to see the Previously loaded screen/page in the masked area.

    Thanks.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      Hi,

      I think that you don`t actualy see old page, but it is just artefacts left from previous widget drawings. If you have compositing, try "this":http://doc.qt.nokia.com/stable/qwidget.html#creating-translucent-windows . Unfortunatly, my Kubuntu instalation is broken and I can't test anything that requires video driver, so I can just give suggestions.

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0
      • A Offline
        A Offline
        at_pradeep
        wrote on last edited by
        #3

        Actually it has some timing issues, to make it work we need to delay the process of setting new source to the Loader, for that we need to first set it to 'undefined' and set timer of around 200 ms and when timer triggers then we need to set the new source and then we have to call setMask on this top level window. if we do all this without using timer then after masking we can see the previous screen. I think QT needs some time to remove/clear the loaded screen/page in the Loader Element before loading new page.

        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