20 CNameVariantPairModel::CNameVariantPairModel(
bool withIcon, QObject *parent)
26 (void)QT_TRANSLATE_NOOP(
"ViewNameVariantPairList",
"name");
27 (void)QT_TRANSLATE_NOOP(
"ViewNameVariantPairList",
"value");
43 const CIcon &icon,
bool skipEqualValues)
72 if (rowIndex < 0)
return;
73 QModelIndex i = this->
index(rowIndex, 0);
82 if (rowIndex < 0) {
return false; }
83 QModelIndex i = this->
index(rowIndex, 0);
85 return value == CVariant::from(cv);
static CColumn standardString(const QString &headerName, const swift::misc::CPropertyIndex &propertyIndex, int alignment=CDefaultFormatter::alignDefault())
Get a standard string object formatted column.
void addColumn(const CColumn &column)
Add a column.
virtual const ObjectType & at(const QModelIndex &index) const
Object at row position.
virtual void push_back(const ObjectType &object)
Similar to ContainerType::push_back.
virtual void remove(const ObjectType &object)
Remove object.
ContainerType m_container
used container
virtual int update(const ContainerType &container, bool sort=true)
Update by new container.
virtual bool setSortColumnByPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex)
Set column for sorting.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const final
CColumns m_columns
columns metadata
Qt::SortOrder m_sortOrder
sort order (asc/desc)
bool containsName(const QString &name) const
Contains name already?
bool addOrUpdateByName(const QString &name, const swift::misc::CVariant &value, const swift::misc::CIcon &icon, bool skipEqualValues)
Add our update a value.
int getRowIndexForName(const QString &name) const
Current row index of given name.
bool containsNameValue(const QString &name, const swift::misc::CVariant &value) const
Contains name / value?
void removeByName(const QString &name)
Remove by given name.
void setIconMode(bool withIcon)
Icon on / off.
Value object for icons. An icon is stored in the global icon repository and identified by its index....
int getIndexForName(const QString &name) const
Get name's index, -1 if not found.
bool containsName(const QString &name) const
Contains name.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Models to be used with views, mainly QTableView.
Free functions in swift::misc.