How to configure the Qt Quick Controls2.config file

    Since the Qt Quick Controls2 project is mainly to meet the needs of mobile development, many cross-platform extensions have been made. The configuration of the project here is one of the convenient ways to configure the style of the QML project, so that we can customize the style of the QML component independently.

    


First we create a new project and select the qt quick Controls 2 type. As shown below. Then specify the path to the project.


After the project is created, as shown in the figure below, our project structure is as shown below, and the code above is directly the ApplicationWindow+SwipeView component



Then we run it, the interface style is already very beautiful. In addition, SwipeView itself is a sliding view, that is, if you swipe with your finger, it is better to operate, which means that it is more suitable for browsing on the mobile terminal.


The directory structure of the project I use is the previous project, the directory structure is as follows, and then we focus on the configuration file qtquickcontrols2.conf as shown below. Two styles are specified here, Material and Universal, which are mainly determined by the Controls tag. We should have seen the value of the Theme attribute when we created the project, such as Light, Dark, etc.




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325518222&siteId=291194637