![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrfGuiCoreQt library between VR-Forces 5.2 and 5.3.
This library holds the Qt dialogs, menu items, toolbars, and panel pages that make up the VR-Forces front end, and it is the library most often subclassed or replaced by toolkit applications that customize the user interface.
The bulk of the change in 5.3 falls into four areas: the checkpoint and snapshot user interface was reworked and expanded, the scenario run-duration dialog became a run-until dialog, the selection filter API used by the entity selection and aggregate dialogs gained explicit filter execution, and the Tactical Data Link (TDL) message user interface was removed. In addition, several dialogs gained creator classes so that applications can substitute their own subclasses.
Changes that are internal to an implementation or limited to comments are not listed.
DtEntitySelectionDialog, DtAggregateAsDialog, and the DtAggregateAsDialogInterface abstract base all changed the way selection filters are applied. In 5.2, each call to addFilter re-ran the filter over the list immediately. In 5.3, addFilter takes an executeFilter flag that defaults to false, and a new filterItems method applies the accumulated filter set in one pass. Add all filters first, then call filterItems once.
The affected declarations are:
| Class | 5.2 declaration | 5.3 declaration |
|---|---|---|
DtAggregateAsDialogInterface | virtual DtVrfSelectionFilter* addFilter(const DtVrfSelectionFilter*) = 0; | virtual DtVrfSelectionFilter* addFilter(const DtVrfSelectionFilter*, bool executeFilter = false) = 0; |
DtAggregateAsDialogInterface | *(none)* | virtual void filterItems() = 0; |
DtAggregateAsDialog | virtual DtVrfSelectionFilter* addFilter(const DtVrfSelectionFilter*) override; | virtual DtVrfSelectionFilter* addFilter(const DtVrfSelectionFilter*, bool executeFilter = false) override; |
DtEntitySelectionDialog | virtual void addFilter(const DtVrfSelectionFilter* f); | virtual void addFilter(const DtVrfSelectionFilter* f, bool executeFilter = false); |
Because filterItems is pure virtual on DtAggregateAsDialogInterface, any class that implements that interface directly must supply an implementation before it will compile.
DtAggregateAsDialogInterface::selectFilter(int) and the DtAggregateAsDialog override were removed. There is no replacement; filter selection by index is no longer part of the contract. Code that called selectFilter should instead build the desired filter set through addFilter and apply it with filterItems.
The dialog that controlled how long a scenario runs was reworked to specify an absolute stop time rather than a duration. The header, the dialog class, the menu item class, and the time entry widget member were all renamed. The class structure is otherwise identical, so the update is mechanical.
| 5.2 name | 5.3 name |
|---|---|
vrfGuiCoreQt/setScenarioRunDurationDialog.h | vrfGuiCoreQt/setScenarioRunUntilDialog.h |
DtSetScenarioRunDurationDialog | DtSetScenarioRunUntilDialog |
DtSetScenarioRunDurationDialog::myRunDurationTime | DtSetScenarioRunUntilDialog::myRunUntilTime |
DtSetScenarioRunDurationMenuItem (in playScenarioMenuItem.h) | DtSetScenarioRunUntilMenuItem |
The static create and registerInstance entry points keep their names and signatures on the renamed class:
The widget that shows the available snapshot list was renamed to match the terminology already used by its methods and members. The header moved with it. The class layout, the protected virtuals, and the public widget members are unchanged.
| 5.2 name | 5.3 name |
|---|---|
vrfGuiCoreQt/availableCheckpointsWidget.h | vrfGuiCoreQt/availableSnapshotsWidget.h |
DtAvailableCheckpointsWidget | DtAvailableSnapshotsWidget |
DtAvailableCheckpointsWidgetBuilder | DtAvailableSnapshotsWidgetBuilder |
Applications that registered a custom builder for this widget must register the renamed builder type.
The TDL message list and its context menu were removed from the front end. The following public and protected virtuals no longer exist:
The associated protected members myTDLForceType, myDomainItems, and myTDLReportRootNode were removed from DtVrfOrganizedObjectListPageLogic. Subclasses that overrode any of the removed virtuals will fail to compile because of the override specifier, and subclasses that referenced the removed members must drop those references. There is no replacement user interface.
Staggered object discovery changed from an on/off switch to a work threshold. The setter and getter changed type, and the default changed from false to -1.
Code that passed true should pass the operation count at which staggering should begin. Code that passed false should pass a negative value to disable staggering. Overrides of the setter must change their parameter type.
The protected override changed its return type to report whether the metadata was accepted:
This change originates in the base class in vrfutil. Any subclass that overrides this method must change its return type and return a value.
The removal notification is now keyed by simulation object UUID rather than by element ID:
The widget now reacts to selection changes rather than to clicks, so the protected slot was replaced:
Subclasses that overrode itemClicked must move that logic into itemSelectionChanged and query the widget for the current selection rather than relying on the item argument.
The dialog now uses the generalized aimable system enumerations instead of the sensor-specific ones. The header include changed from vrfExtObjects/sensorFieldOfViewEnums.h to vrfExtObjects/aimableSystemEnums.h, and the protected member type changed accordingly:
At the same time, the misspelled method checkJoystickAvailablity was corrected to checkJoystickAvailability. Overrides and call sites must use the corrected spelling.
The scenario information and scenario modification classes no longer expose a random number seed, a starting date and time, or a day/night model element. The following enumerators were removed from DtScenarioInformationWidget::DisplayElement:
| Removed enumerator |
|---|
StartingDateAndTime |
UseDayNightModel |
RandomNumberSeed |
The remaining enumerators keep their relative order, but because the enumeration is unscoped and implicitly valued, any code that relied on the numeric value of an enumerator after the removed ones must be rechecked. These enumerators are accepted by setDisplayChangeWarningIcon, setVisibleScreenElement, and setEnableScreenElement on DtScenarioInformationWidget, DtScenarioPreviewWidget, DtScenarioPreviewPage, and DtScenarioDescriptionDialog; calls passing a removed enumerator must be deleted.
In DtScenarioModificationHandler, the corresponding RandomNumberSeed = 0x00000040 bit was removed from the change-on-save flag enumeration. The bit value itself is now unused and reserved, so existing flag masks remain numerically valid, but the named constant is gone.
Finally, the protected helper DtScenarioInformationWidget::updateTimeOfDay(std::string, std::string) was removed. There is no replacement.
Both DtScenarioInformationWidget and DtScenarioPreviewWidget now accept a const scenario pointer:
Overrides must add const to the parameter type or they will no longer override the base declaration.
Layout spacing is now handled by the widget's expand and collapse behavior for the visual marking and airbase sections. Remove calls to includeSpacer; there is no replacement.
Both altitude setters gained a trailing parameter that controls whether the supplied value is converted before it is displayed. The parameter defaults to a false value, so existing calls compile unchanged, but overrides must match the new signature:
The expand and collapse aggregate menu items in vrfEntityMenu.h now rely on the base makVrv::DtMenuItem::createAction implementation. The following overrides were removed:
| Class | Removed overrides |
|---|---|
DtVrfExpandAggregateMenuItem | createAction |
DtVrfExpandAllAggregateMenuItem | createAction |
DtVrfCollapseAggregateMenuItem | createAction, on_aboutToShow |
DtVrfCollapseAllAggregateMenuItem | createAction |
A subclass that called the removed override through its own createAction must call the base class implementation instead.
The protected map that tracks observed spot reports is now keyed to UUIDs rather than element unique identifiers:
The protected QPixmap myGrayscaleImage member was removed. Subclasses that referenced it must supply their own pixmap.
| 5.2 path | 5.3 path |
|---|---|
vrfGuiCoreQt/availableCheckpointsWidget.h | vrfGuiCoreQt/availableSnapshotsWidget.h |
vrfGuiCoreQt/setScenarioRunDurationDialog.h | vrfGuiCoreQt/setScenarioRunUntilDialog.h |
vrfGuiCoreQt/tagSelectorWidget.h | vrfGuiCommonQt/tagSelectorWidget.h |
tagSelectorWidget.h moved without changing its contents so that it can be shared by front-end components outside vrfGuiCoreQt. Applications that included it directly must update the include path. vrfGuiCoreQt/createObjectPaletteInterface.h now pulls in the header from its new location, so code that relied on that transitive include continues to work.
A complete user interface for browsing, loading, renaming, and deleting back-end scenario checkpoints was added.
vrfGuiCoreQt/loadScenarioCheckpointDialog.h defines DtLoadScenarioCheckpointDialog, a dialog that queries the connected back ends for their checkpoint files and presents them as a scenario run tree with the checkpoints for the selected run. It offers load, save-as-scenario, rename, delete checkpoint, delete scenario, and information actions, all exposed as protected virtuals so that subclasses can alter individual behaviors. The companion DtLoadScenarioCheckpointDialogCreator follows the registered-creator pattern described below.
vrfGuiCoreQt/scenarioCheckpointsWidget.h defines DtScenarioCheckpointsWidget, a toolbar widget for taking a checkpoint, opening the checkpoint settings, enabling periodic checkpoints, and opening the checkpoint manager. It is accompanied by DtScenarioCheckpointsToolbar, a makVrv::DtToolbar subclass that builds the toolbar, and DtScenarioCheckpointsWidgetBuilder.
DtLoadScenarioCheckpointMenuItem was added to vrfGuiCoreQt/loadScenarioMenuItem.h to open the new dialog from a menu.
DtVrfScenarioManager gained the corresponding entry points:
Three dialogs gained a creator class so that an application can substitute its own dialog subclass without replacing the code that opens the dialog. All three follow the same shape:
| Header | Creator | Default window flags |
|---|---|---|
loadScenarioDialog.h | DtLoadScenarioDialogCreator | Qt::Tool |
loadScenarioCheckpointDialog.h | DtLoadScenarioCheckpointDialogCreator | Qt::Tool |
joinSessionDialog.h | DtJoinSessionDialogCreator | 0 |
Register a subclass creator during application startup, before the dialog is first opened.
The new header vrfGuiCoreQt/clearAllWarningsMenuItem.h defines a makVrv::DtMenuItem subclass that clears all outstanding warnings. Its action is enabled and disabled in response to console messages.
vrfGuiCoreQt/createObjectPaletteFilters.h gained a DtPaletteFilter subclass that accepts a creation item only if the unit has a system with the given name:
Note that local palette filters combine with a logical OR: if any registered filter accepts an item, the item is added. This was previously undocumented and is now stated in DtCreateObjectPaletteLogic::addLocalPaletteFilter.
DtScenarioInformationWidget gained an overload that fills the display from a scenario object rather than from a file name:
DtScenarioPreviewWidget and DtScenarioPreviewPage each gained a matching virtual:
This overloads the existing previewScenario(const QString&) slot. A subclass that declares its own previewScenario will hide both base overloads unless it introduces them with a using declaration.
DtPointObjectDefinitionWidget gained altitude mode control, a location backup mechanism, and collapsible sections:
DtPointObjectDefinitionDialogLogic gained the matching clearBackupLocation and cacheBackupLocation virtuals. The dialog also exposes new public widget members for the airbase section header (myAirbaseTitleWidget, myAirbaseTitleLayout, myAirbaseLabel, myAirbaseSeparator, myExpandCollapseAirbase) and a myCanvas container widget.
DtMunitionDetonationDefinitionDialog now overrides setLocation:
DtMissileTargetWidget gained public activation and protected copy and paste support:
DtVrfOrganizedObjectListPanelPage gained a header context menu with expand-all and collapse-all actions, plus an activation override:
The corresponding protected members myRightClickHeaderMenu, myExpandAll, and myCollapseAll were added. DtVrfOrganizedObjectListPageLogic gained createBullseyeObjectRootNode so that bullseye objects appear under their own root node.
DtVrfHierarchyPageLogic gained a notification for state view removal, matching the existing slot_onStateViewAdded:
DtScriptEditor can now be given scripted task metadata to write alongside the temporary script file that is handed to the external editor:
vrfGuiCoreQt/scriptEditor.h now includes vrfutil/scriptedTaskMetaData.h for the parameter type.
DtSelectionGroupWidget gained a protected virtual that is invoked when the fog of war filter changes, so that group membership can be re-evaluated:
| Header | Breaking | Additions |
|---|---|---|
aggregateAsDialog.h | addFilter signature; selectFilter removed | filterItems |
aggregateAsDialogInterface.h | addFilter signature; selectFilter removed; new pure virtual | filterItems |
availableCheckpointsWidget.h | Renamed to availableSnapshotsWidget.h | None |
clearAllWarningsMenuItem.h | None | DtClearAllWarningsMenuItem |
createObjectPaletteFilters.h | None | DtUnitHasSystemNamed |
createObjectPaletteInterface.h | Include path of tagSelectorWidget.h | None |
entitySelectionDialog.h | addFilter signature | filterItems |
joinSessionDialog.h | None | DtJoinSessionDialogCreator |
loadScenarioCheckpointDialog.h | None | DtLoadScenarioCheckpointDialog, creator |
loadScenarioDialog.h | None | DtLoadScenarioDialogCreator |
loadScenarioMenuItem.h | None | DtLoadScenarioCheckpointMenuItem |
localWeatherManagerWidget.h | slot_removed parameter type | None |
missileTargetWidget.h | itemClicked replaced by itemSelectionChanged | activate, copy and paste |
munitionDetonationDefinitionDialog.h | None | setLocation override |
playScenarioMenuItem.h | DtSetScenarioRunDurationMenuItem renamed | None |
pointObjectDefinitionDialog.h | includeSpacer removed; altitude setter signatures | Altitude mode, backup location, collapsible sections |
pointObjectDefinitionDialogLogic.h | None | clearBackupLocation, cacheBackupLocation |
qtVrfScriptedTaskManager.h | addScriptedTaskMetaData return type | None |
scenarioCheckpointsWidget.h | None | DtScenarioCheckpointsWidget, toolbar, builder |
scenarioEventManagerDialog.h | myGrayscaleImage removed | None |
scenarioInformationWidget.h | DisplayElement enumerators removed; setScenario const; updateTimeOfDay removed | displayScenarioInformation(const DtScenario&), previewScenario(const DtScenario&) |
scenarioModificationHandler.h | RandomNumberSeed flag removed | None |
scenarioPreviewPage.h | None | previewScenario(const DtScenario&) |
scriptEditor.h | None | setTempMetaDataHint |
selectionGroupWidget.h | None | slot_fogOfWarFilterChanged |
sensorControlDialog.h | DtSensorTrackingMode replaced; checkJoystickAvailablity renamed | None |
setScenarioRunDurationDialog.h | Renamed to setScenarioRunUntilDialog.h | None |
tagSelectorWidget.h | Moved to vrfGuiCommonQt | None |
vrfContextMenuManager.h | createTDLMessageContextMenu removed | None |
vrfEntityMenu.h | Aggregate menu item overrides removed | None |
vrfHierarchyPageLogic.h | setStaggerObjectDiscovery type; filterTDLItems removed | slot_onStateViewDeleted |
vrfOrganizedObjectListPanelPage.h | TDL methods and members removed; mySpotReportsObserved type | Header context menu, expand and collapse, bullseye root node |
vrfScenarioManager.h | None | Checkpoint dialog entry points |
Return to VR-Forces 5.3 API Migration Guide.
[Home]