title: Qt ( Qml ) setting window components visibility before loading it
body: <p>I am designing a GUI which has a login and graphic window with Qt. Graphic window functionality changes due to user who logins( there are 3 different authorization levels to be more precise). So I want to hide some menubars, buttons, and other components depending on the user authorization level. I tried something like</p>
  <pre><code>Window {
      id: window
      width: Screen.desktopAvailableWidth / 1.7
      height: Screen.desktopAvailableHeight / 1.7
      visible: true
  
      onSceneGraphInitialized: {
      if (Glob_vals.login_instance === true &amp;&amp; setting_check.get_user_level_int() !== 2) {
          Glob_vals.login_instance = false
          add_new_user_button.visible = false
      }
  }
  </code></pre>
  <p>But It firstly initializes the button then changes visibility. How can I change visibility before loading the screen? Thanks in advance.
  Note: Qt version is 5.15.2</p>