December 1, 2011

spyhunter88 spyhunter88
Lab Rat
4 posts

How to “refresh” ToolBar in a Page UI?

 

I have a Page has name myPage in PageStack and define a qml function that allow other qml Item can change its property. I want to change visible and hide its toolbar. (controlsTools is child of this page).

  1.      function setVisible(value)
  2.      {
  3.          visible = value;
  4.          tools = (visible) ? myTools : null;
  5.      }

But when I call this with FALSE, only page is invisible but tools is still there and also can click in the toolbar.
When in this page, I push another page to pagestack, after that I pop() and come back to myPage, if its visible is false, toolbar gone, other if visible is true, toolbar’s still there. That’s the only way now I can hide myTools:
1. push new Page.
2. Set visible to false (do not need if already set before).
3. pop() to comeback to myPage.

And if myTools is hide, I cannot take it back with this function.

So I call “refresh” because I guess it doesn’t refresh the tools UI although the myTools is set to null.

0 replies

 
  ‹‹ While unloading from a loader element, Qml goes to its base state by default      How to get .exe parameters into QML app? ››

You must log in to post a reply. Not a member yet? Register here!