![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrfGuiDataEntryWidgets library between VR-Forces 5.2 and 5.3.
The widgets in this library are the building blocks of task and plan dialogs, and toolkit developers reuse them directly when writing custom dialogs and scripted task parameter widgets.
The largest change in 5.3 is the redesign of DtVrfFilteredListView. The single filter combo box that selected one named filter at a time was replaced by a search field, a force selector, and a tag selector that filter the full item list together. Every API that named, selected, or executed "the
current filter" was removed as a result, and the affected virtual functions on DtVrfFilteredListViewInterface and DtVrfFilteredListViewLogic changed with it.
Two smaller cross-cutting changes affect several widgets: the emitter modes requestor type moved out of vrfGuiCore into vrfcontrol, and the altitude setters gained a unit-conversion flag.
Changes that are internal to an implementation or limited to comments are not listed.
The pure virtual functions that managed the filter combo box were removed from the interface. Any class that implements DtVrfFilteredListViewInterface must delete these overrides, and any caller that used them through the interface must be reworked.
| Removed in 5.3 | Replacement |
|---|---|
virtual void addFilterToList(const DtVrfSelectionFilter*) = 0 | None. addFilter now performs the whole operation. |
virtual void removeFilterFromList(const QString&) = 0 | None. removeFilter performs the whole operation. |
virtual void selectFilter(int) = 0 | filterItems(bool andSelectFirstItem = false) |
virtual void selectFilter(const QString&) = 0 | filterItems(bool andSelectFirstItem = false) |
virtual QString currentFilter() const = 0 | None. There is no single current filter; use selectedForces, selectedCategories, and the text filter. |
virtual void executeCurrentFilter() = 0 | executeTextFilter(), executeForceFilter(), or filterItems() |
The following pure virtual functions were added and must be implemented by any class deriving from the interface:
addFilter takes a third argument on the interface, on DtVrfFilteredListView, and on DtVrfFilteredListViewLogic:
Existing calls compile unchanged because the new parameter is defaulted, but every override must be updated to the new signature or it will no longer override the base declaration. Pass false for executeFilters when adding a batch of filters, then call filterItems() once at the end.
The removal methods report whether an item was actually removed. Overrides must be updated to the new return type.
| 5.2 declaration | 5.3 declaration |
|---|---|
virtual void removeItem(DtSimObjectReference) | virtual bool removeItem(DtSimObjectReference) |
virtual void removeItem(QTreeWidgetItem*) | virtual bool removeItem(QTreeWidgetItem*) |
virtual void removeItem(makVrv::DtUniqueID) | virtual bool removeItem(makVrv::DtUniqueID) |
virtual void DtVrfFilteredListViewLogic::onRemoveObject(makVrv::DtUniqueID, bool) | virtual bool DtVrfFilteredListViewLogic::onRemoveObject(makVrv::DtUniqueID, bool) |
The methods that configured or queried the filter combo box were removed from DtVrfFilteredListView:
Code that called selectFilter or selectFirstNonEmptyFilter to refresh the list should call filterItems instead:
clearAll no longer removes filters; it only removes items. Call removeAllFilters separately if the filter set must also be discarded.
hideFilter was a virtual function in 5.2. In 5.3 it is a non-virtual inline convenience wrapper:
A derived class that declared hideFilter with override will no longer compile. Override the new virtual setShowFilters(bool) instead.
The public member variables that exposed the filter combo box were removed or retyped. Derived classes and dialog code that laid out or styled these widgets directly must be updated.
| 5.2 member | 5.3 member |
|---|---|
QLabel* myFilterLabel | Removed |
QComboBox* myFilters | QWidget* myFilters (container for the force and tag selectors) |
QHBoxLayout* myFilterLayout | QVBoxLayout* myFiltersLayout |
| — | DtSearchWidget* mySearchWidget |
| — | DtTagSelectorWidget* myTags |
| — | DtForceSelectionEntryWidget* myForce |
| — | QHBoxLayout* myNameLayout |
The protected flags myFilterLabelIsHidden and myFilterHidden were removed; the new protected state is myShowFilters, myShowSearch, myTextFilter, myCollapsedSize, and myExpandedSize.
The expansion signal now carries the collapsed and expanded sizes so that a hosting dialog can re-fit itself. The change affects DtVrfFilteredListView, DtLocationEntryWidget, and DtLocationReferenceEntryWidget:
Every connect to this signal and every receiving slot must be updated to the three-argument form. On DtLocationReferenceEntryWidget the signal is declared as expansionStateChanged(bool, const QSize&, const QSize&).
The logic class lost the methods that mapped an item to the filter that contained it, along with the TDL report view support.
Because items are no longer partitioned across filters, an item is visible when it passes every active filter and no lookup of a containing filter is required. Call filterItems to re-evaluate the list.
The protected member DtVrfTDLSettingsRecord myTDLSettingsRecord was removed, and vrfGuiCore/vrfTDLSettingsRecord.h is no longer included by this header. Code that relied on that transitive include must include it directly.
passesFilterTest moved from the protected section to the public section, became const, and gained an output parameter that reports the index of the filter the object matched:
connectIfShouldUpdate and passesAnyFilter gained the same output parameter:
Overrides that kept the 5.2 signatures no longer override the base declarations. The new parameter may be ignored by passing nullptr.
DtAerodromeListView followed the filtered list view redesign:
addFilter is overridden so that aerodromes loaded from DtVrfAerodromeLoader are re-added after the base class repopulates the list. A new protected member myFilteredItems tracks whether the initial filter pass has run.
The override was removed along with the base class declaration. Remove the corresponding override from any derived class.
The requestor that supplies emitter and mode data changed from makVrf::DtEmitterModesRequestor (declared in vrfGuiCore/emitterModesRequestor.h) to the global-scope DtRemoteControlEmitterModesRequestor (declared in vrfcontrol/remoteControlEmitterModesRequestor.h). The virtual accessor emitterModesRequestor is protected in every emitter-related widget, so this affects derived classes:
The nested type used for the mode collection changed at the same time, from DtEmitterModesRequestor::EmitterModes to DtRemoteControlEmitterModesRequestor::EmitterModes. This is the type of the protected member myEmitterModes on DtEmitterModesSelectionEntryWidget.
The following classes are affected:
Forward declarations must also move out of the makVrf namespace, because DtRemoteControlEmitterModesRequestor is declared at global scope.
The double overloads of the altitude setters take an additional flag that controls whether the supplied value is converted into the current display units before being shown. The default is false, which preserves 5.2 behavior for callers, but every override must be updated.
The QString overloads are unchanged.
The accessor changed from an inline non-virtual member returning the flag to a virtual function:
The return value is now computed rather than read directly from myAllowMultipleForceSelection, so a derived class that reads the member instead of calling the accessor may observe a different result.
The protected member int myBin was removed. Bin selection is now driven by the new bins control; see setShowBins under Additions. Derived classes that read or wrote myBin must be reworked.
The protected member std::string myAppearance was removed. Derived classes that referenced it must be updated.
The default implementation returns a different icon path:
This affects only widgets that do not override designerIcon. Custom widgets that hard-coded the 5.2 path in their own override should move to the new location.
The new header vrfGuiDataEntryWidgets/sidcPickWidget.h defines a data entry widget for building a MIL-STD-2525D / APP-6D symbol identification code, plus the combo box it uses.
DtSidcPickWidget derives from DtTaskSetVariableWidget, so it can be used as a scripted task parameter widget and registered through DtSidcPickWidgetCreator. It presents one combo box per SIDC field, identified by the nested ComboType enum:
The principal API is:
The nested SIDCField struct pairs a DtSidcComboBox with its QLabel, and the populated fields are available through the public myCombos map keyed by ComboType.
DtSidcComboBox is a QComboBox subclass that paints the symbol icon for each entry. It exposes enableSearch(bool), setShowScheduled(bool), inMouseEvent(), shouldShowPopup(), the showPopupFromFocus and hidePopupFromCompletion slots, and a popupShown(bool) signal.
The methods that replace the filter combo box are:
setCheckFogOfWarFilters(bool) was added to both DtVrfFilteredListView and DtVrfFilteredListViewLogic. It defaults to true, preserving 5.2 behavior. It does not refilter immediately; call filterItems() afterwards.
DtVrfFilteredListView also gained virtual QSize minimumSizeHint() const override, the protected slots completeCollapse, completeExpand, and textChanged, the protected slot slot_onTagsChanged(const std::vector<std::string>&), and the protected forceTypeChanged method.
addObject is the counterpart to the now-bool onRemoveObject and reports whether the object was added to the list.
A new boost signal notifies a hosting dialog that the widget's preferred size changed, so the dialog can re-fit and reclaim freed space:
A new public slot shows or hides all selection controls at once, honoring the current displayWeapons() and displayResources() settings when re-showing. When hidden, the widget collapses to zero height and emits signal_contentsSizeChanged:
The existing resourcesSetUp signal is unchanged; it fires when the dialog is populated with new entries, while resourcesReceived fires once the full resource set has arrived. The bins check box is available through the new public member QCheckBox* myShowBins.
The default is false, which preserves 5.2 behavior.
Returns the display titles of the currently selected forces, which is useful when multiple force selection is enabled.
locationTabSelected reports when the user switches to or away from the location tab.
Reports whether the widget is currently entering altitude above ground level rather than above sea level.
DtLocationEntryWidget gained the protected slots completeExpand and completeCollapse, which complete the animated size change and emit the new three-argument expansionStateChanged signal.
Returns the duration, in seconds, of the currently selected DI-Guy gesture.
Return to VR-Forces 5.3 API Migration Guide.
[Home]