8 #include <QIntValidator>
11 #include <QWidgetAction>
19 using namespace swift::misc::aviation;
35 this->selectCallsigns(cs);
41 if (callsigns.
isEmpty()) {
return; }
42 this->clearSelection();
48 if (callsigns.
contains(obj.getCallsign())) { rows.insert(r); }
50 this->selectRows(rows);
58 return selected.getCallsigns();
66 return this->removeCallsigns(set);
72 if (callsigns.
isEmpty()) {
return 0; }
73 if (this->isEmpty()) {
return 0; }
76 int delta = newObjects.removeByCallsigns(callsigns);
77 if (delta > 0) { this->updateContainerMaybeAsync(newObjects); }
84 if (container.isEmpty()) {
return 0; }
86 const int c = copy.replaceOrAddObjectsByCallsign(container);
87 if (c == 0) {
return 0; }
88 this->updateContainerMaybeAsync(copy);
96 const int c = copy.replaceOrAddObjectByCallsign(
object);
97 if (c == 0) {
return 0; }
98 this->updateContainerMaybeAsync(copy);
105 if (!selectedObjects.isEmpty()) { this->selectCallsigns(selectedObjects.getCallsigns()); }
typename T::ObjectType ObjectType
Model container element type.
typename T::ContainerType ContainerType
Model container type.
Base class for views with DB objects.
void selectCallsigns(const swift::misc::aviation::CCallsignSet &callsigns)
Select given callsigns.
int removeCallsign(const swift::misc::aviation::CCallsign &callsign)
Remove callsign.
int replaceOrAddObjectByCallsign(const ObjectType &object)
Update or insert data (based on callsign)
int removeCallsigns(const swift::misc::aviation::CCallsignSet &callsigns)
Remove callsigns.
int replaceOrAddObjectsByCallsign(const ContainerType &container)
Update or insert data (based on callsign)
swift::misc::aviation::CCallsignSet selectedCallsigns() const
Get selected callsigns.
virtual void selectObjects(const ContainerType &selectedObjects)
Reselect by callsigns.
void selectCallsign(const swift::misc::aviation::CCallsign &callsign)
Select callsign.
bool isEmpty() const
Synonym for empty.
bool contains(const T &object) const
Return true if there is an element equal to given object. Uses the most efficient implementation avai...
Value object encapsulating information of a callsign.
bool isEmpty() const
Is empty?
Value object for a set of callsigns.
Models to be used with views, mainly QTableView.
Views, mainly QTableView.
Free functions in swift::misc.