Qt Quick Controls Platform Notes

此页面包含特定平台注意事项,为创建应用程序使用 Qt Quick Controls .

Android 样式

Qt 5.4 introduced a native Android style for Qt Quick Controls.

注意: The Android style requires Android 3.0 (API level 11) or later.

The style is automatically selected and deployed on Android. See Qt for Android 快速入门 and 在 Android 部署应用程序 for more details on the Android essentials.

Android 主题

Applications may choose a specific Android theme by specifying it in AndroidManifest.xml .

The following example sets a dark Holo theme, and the result can be seen in the screenshot above.

<manifest ...>
  <application ... android:theme="@android:style/Theme.Holo">
    ...
  </application>
  ...
</manifest>
					

动作栏

The 动作栏 is a special Android control that provides many key features including various navigation modes, actions, an options menu, a back button, and also displays the application icon and title.

不像 Qt Widgets , Qt Quick Controls do not use the native action bar on Android. ToolBar and MenuBar are offered as a cross-platform replacement. They are unified to a single "action bar" when assigned to the appropriate ApplicationWindow 特性。

The advantage of a non-native ToolBar is that it can contain any child items declared in QML. Just to name a few possibilities: