QG地面站
首次运行提示当QGC第一次启动时,它会提示用户指定一些初始设置。在撰写本文档时,这些是:
单位设置-用户要使用什么单位进行显示。
离线车辆设置-用于在未连接到车辆时创建计划的车辆信息。
自定义生成架构包括用于自定义生成的机制,以覆盖这些提示的显示和/或创建您自己的首次运行提示。
首次运行提示对话框每个第一次运行提示都是一个简单的对话框,可以向用户显示ui。特定对话框是否已经显示给用户存储在设置中。下面是上游第一次运行提示对话框的代码:
单位设置
离线车辆设置
标准的首次运行提示对话框每个对话框都有一个与之关联的唯一ID。当该对话框显示给用户,该ID被注册为已经显示,所以它只发生一次 (除非你清除设置)。上游QGC包含的第一个运行提示集被认为是 "标准" 集。QGC获取要从显示的标准提示列表QGCCorePlugin::firstRunPromptStdIds打电话。
/// Returns the standard list of first run prompt ids for possible display. Actual display is based on the
/// current AppSettings::firstRunPromptIds value. The order of this list also determines the order the prompts
/// will be displayed in.
virtual QList
如果要隐藏其中一些,可以在自定义生成中重写此方法。
自定义首次运行提示对话框自定义构建能够根据需要通过使用以下QGCCorePlugin方法覆盖来创建自己的一组附加首次运行提示:
/// Returns the custom build list of first run prompt ids for possible display. Actual display is based on the
/// current AppSettings::firstRunPromptIds value. The order of this list also determines the order the prompts
/// will be displayed in.
virtual QList
/// Returns the resource which contains the specified first run prompt for display
Q_INVOKABLE virtual QString firstRunPromptResource(int id);
您的QGCCorePlugin应该覆盖这两种方法,并为新的第一次运行提示的id提供静态consts。看看标准集是如何实现的,如何做到这一点,并采取相同的方法。
显示顺序显示给用户的一组首次运行提示按照QGCCorePlugin::firstRunPromptStdIds和QGCCorePlugin::firstRunPromptCustomIds在自定义提示之前显示标准提示。仅示出了先前未向用户示出的提示。
始终开启提示通过设置markAsShownOnClose: false属性在提示ui实现中,您可以创建一个提示,每次QGC启动时都会显示。这可以用于向用户显示使用提示之类的事情。如果你这样做,最好确保它最后显示。