Loading the flight modes page

We dont want the flight modes to be visible to everyone. So from the flightmodes.cc page we are calling a login.qml page and once the credentials are correct we want to display the fightmodes.qml page page. We are able to call our page from the c++ function but we are not able to call the PX4Flightmodes.qml from a normal loader. Iam attaching a snippet of our login page. It would be great if someone can tell how to load the flight mode page with validation of credentials.