3#include <QtCore/QObject>
5#include <QtQmlIntegration/QtQmlIntegration>
44 int rowCount (
const QModelIndex & parent = QModelIndex())
const override;
45 int columnCount (
const QModelIndex &parent = QModelIndex())
const override;
46 QVariant
data (
const QModelIndex & index,
int role = Qt::DisplayRole)
const override;
47 QVariant
headerData (
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
48 QHash<int, QByteArray>
roleNames(
void)
const override;
54 bool _isResetting()
const {
return _resetNestingCount > 0; }
56 int _tableViewColCount = 4;
57 QList<ColumnData> _tableData;
58 uint _resetNestingCount = 0;
68 Q_PROPERTY(QString
name MEMBER
name CONSTANT)
85 Q_PROPERTY(QString
name MEMBER
name CONSTANT)
103 Q_PROPERTY(QString
name MEMBER
name CONSTANT)
107 Q_PROPERTY(QString
units MEMBER
units CONSTANT)
128 Q_PROPERTY(QString searchText MEMBER _searchText NOTIFY searchTextChanged)
130 Q_PROPERTY(QObject* currentCategory READ currentCategory WRITE setCurrentCategory NOTIFY currentCategoryChanged)
131 Q_PROPERTY(QObject* currentGroup READ currentGroup WRITE setCurrentGroup NOTIFY currentGroupChanged)
132 Q_PROPERTY(QAbstractTableModel* parameters MEMBER _parameters NOTIFY parametersChanged)
133 Q_PROPERTY(
bool showModifiedOnly MEMBER _showModifiedOnly NOTIFY showModifiedOnlyChanged)
134 Q_PROPERTY(
bool showFavoritesOnly MEMBER _showFavoritesOnly NOTIFY showFavoritesOnlyChanged)
135 Q_PROPERTY(
bool hideReadOnly MEMBER _hideReadOnly NOTIFY hideReadOnlyChanged)
136 Q_PROPERTY(QStringList favoriteParameterNames READ favoriteParameterNames NOTIFY favoritesChanged)
139 Q_PROPERTY(
bool diffOtherVehicle MEMBER _diffOtherVehicle NOTIFY diffOtherVehicleChanged)
140 Q_PROPERTY(
bool diffMultipleComponents MEMBER _diffMultipleComponents NOTIFY diffMultipleComponentsChanged)
147 Q_INVOKABLE
void saveToFile (
const QString& filename);
148 Q_INVOKABLE
bool buildDiffFromFile (
const QString& filename);
149 Q_INVOKABLE
void clearDiff (
void);
150 Q_INVOKABLE
void sendDiff (
void);
151 Q_INVOKABLE
void refresh (
void);
152 Q_INVOKABLE
void resetAllToDefaults (
void);
153 Q_INVOKABLE
void resetAllToVehicleConfiguration (
void);
154 Q_INVOKABLE
void toggleFavorite (
const QString& paramName);
155 Q_INVOKABLE
bool isFavorite (
const QString& paramName)
const;
156 Q_INVOKABLE
void clearAllFavorites (
void);
162 QStringList favoriteParameterNames (
void)
const;
163 void setCurrentCategory (QObject* currentCategory);
164 void setCurrentGroup (QObject* currentGroup);
179 void _currentCategoryChanged(
void);
180 void _currentGroupChanged (
void);
181 void _searchTextChanged (
void);
182 void _hideReadOnlyChanged (
void);
183 void _buildLists (
void);
184 void _buildListsForComponent(
int compId);
185 void _factAdded (
int compId,
Fact* fact);
188 bool _shouldShow(
Fact *fact)
const;
189 void _performSearch();
190 void _loadFavorites();
191 void _saveFavorites();
199 bool _showModifiedOnly =
false;
200 bool _showFavoritesOnly =
false;
201 bool _hideReadOnly =
false;
202 bool _diffOtherVehicle =
false;
203 bool _diffMultipleComponents =
false;
204 QSet<QString> _favoriteNames;
209 QAbstractTableModel* _parameters =
nullptr;
210 QMap<QString, ParameterEditorCategory*> _mapCategoryName2Category;
Used for handling missing Facts from C++ code.
A Fact is used to hold a single value within the system.
QMap< QString, ParameterEditorGroup * > mapGroupName2Group
QmlObjectListModel groups
ParameterEditorCategory(QObject *parent)
QmlObjectListModel * getGroups(void)
void showFavoritesOnlyChanged(void)
void parametersChanged(void)
void currentGroupChanged(void)
QmlObjectListModel * diffList(void)
QmlObjectListModel * categories(void)
void diffMultipleComponentsChanged(bool diffMultipleComponents)
QObject * currentCategory(void)
void searchTextChanged(QString searchText)
void currentCategoryChanged(void)
void diffOtherVehicleChanged(bool diffOtherVehicle)
void favoritesChanged(void)
void showModifiedOnlyChanged(void)
QObject * currentGroup(void)
void hideReadOnlyChanged(void)
void loadChanged(bool load)
FactMetaData::ValueType_t valueType
ParameterEditorDiff(QObject *parent)
QAbstractTableModel * getFacts(void)
ParameterTableModel facts
QVector< QVariant > ColumnData
void insert(int row, Fact *fact)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QHash< int, QByteArray > roleNames(void) const override
~ParameterTableModel() override
void rowCountChanged(int count)
void endReset()
Supports nesting - only outermost call has effect.
void beginReset()
Supports nesting - only outermost call has effect.
Fact * factAt(int row) const