How to set up our system by invoking the page in the system settings in the QML app

Source: Internet
Author: User

We sometimes need to call system settings (Systems settings) to complete some of our settings in the QML application. For example, when we use GPS to locate, maybe the GPS does not open, if in our application directly open the system's GPS Settings page, so we can directly open the system's GPS without having to design a separate page. We can open another app by using the URL dispatcher method. In our previous article, we've covered a lot of things about URL dispatcher:

    1. How to send text messages and make calls on your Ubuntu phone
    2. Example of using URL dispatcher

About the System setup (system-settings) of the source code, we can find at the address.
How to view the URL of a system dispatcher typically, we might be wondering if there are URLs dispatcher in the system. We can view the URL of our mobile system by following the name dispatcher:



The above lists the URL dispatcher that we already have in our mobile phone system. For example, we can view the System-settings URL Dispatcher's protocol:

[        {                "protocol": "Settings"        }]


This way we use the following method in our QML application to launch the page in the system setup:
Qt.openurlexternally ("Settings:///system/about");

The above method can open the "about" page in the system settings.
Based on the above understanding, I have designed the following routines to launch different pages in the system settings:
Import QtQuick 2.0import ubuntu.components 1.1/*! \brief MainView with a Label and Button Elements.*/mainview {//ObjectName for functional testing purposes (autopilot- QT5) ObjectName: "MainView"//note!    ApplicationName needs to match the "name" field of the click Manifest ApplicationName: "Urldispatcher.liu-xiao-guo" /* The enables the application to change orientation when the device is rotated.    The default is False.    *///automaticorientation:true//Removes the old toolbar and enables new features of the new header. Usedeprecatedtoolbar:false Width:units.gu (Height:units.gu) var plugins: ["about", "phone", "ba Ttery "," Bluetooth "," brightness "," cellular "," language "," Background "," Flight-mode "," Notifications "," or Ientation-lock "," Reset "," security-privacy "," Sound "," system-update "," Time-date "," WiFi "] page {title : i18n.tr ("Urldispatcher") flickable {CLip:true width:parent.width height:parent.height contentheight:content.childrenrect.h Eight Column {id:content anchors.centerIn:parent spacing:units                        . Gu (1) Repeater {model:plugins Delegate:button { Text:modeldata onclicked: {qt.openurlexternally ("Settings:///sys                        tem/"+ modeldata); }                    }                }            }        }    }}

To run our application:


Application of the source code in: Git clone https://gitcafe.com/ubuntu/urldispatcher.git

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

How to set up our system by invoking the page in the system settings in the QML app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.