swift
Public Member Functions | List of all members
swift::gui::models::CApplicationInfoListModel Class Reference

Application info list model. More...

Inheritance diagram for swift::gui::models::CApplicationInfoListModel:
[legend]

Public Member Functions

 CApplicationInfoListModel (QObject *parent=nullptr)
 Constructor.
 
virtual ~CApplicationInfoListModel ()
 Destructor.
 
void otherSwiftVersionsFromDataDirectories (bool reinit)
 Filled from cache data directories. More...
 
- Public Member Functions inherited from swift::gui::models::CListModelBase< swift::misc::CApplicationInfoList, true >
 ~CListModelBase ()=default
 Destructor.
 
void sort ()
 Sort by given sort order. More...
 
virtual bool isValidIndex (const QModelIndex &index) const
 Valid index (in range)
 
const ContainerTypecontainer () const
 Used container data.
 
const ContainerTypecontainerFiltered () const
 Used container data.
 
const ContainerTypecontainerOrFilteredContainer (bool *filtered=nullptr) const
 Full container or cached filtered container as approproiate.
 
bool setInContainer (const QModelIndex &index, const ObjectType &obj)
 Simple set of data in container, using class is responsible for firing signals etc. More...
 
virtual int update (const ContainerType &container, bool sort=true)
 Update by new container. More...
 
virtual void update (const QModelIndex &index, const ObjectType &object)
 Update single element.
 
virtual void update (int rowIndex, const ObjectType &object)
 Update single element.
 
virtual swift::misc::CWorkerupdateAsync (const ContainerType &container, bool sort=true)
 Asynchronous update.
 
virtual void updateContainerMaybeAsync (const ContainerType &container, bool sort=true)
 Update by new container.
 
virtual void moveItems (const ContainerType &items, int position)
 Move items to position, normally called from dropMimeData. More...
 
virtual const ObjectTypeat (const QModelIndex &index) const
 Object at row position.
 
void resort ()
 Sort by given sort order. More...
 
void truncate (int maxNumber, bool forceSort=false)
 Truncate to given number.
 
ContainerType sortContainerByColumn (const ContainerType &container, int column, Qt::SortOrder order) const
 Sort container by given column / order. This is used by sort() but als for asynchronous updates in the views. More...
 
virtual void push_back (const ObjectType &object)
 Similar to ContainerType::push_back.
 
virtual void push_back (const ContainerType &container)
 Similar to ContainerType::push_back.
 
virtual void insert (const ObjectType &object)
 Similar to ContainerType::insert here inserts at first position.
 
virtual void insert (const ContainerType &container)
 Similar to ContainerType::insert here inserts at first position.
 
virtual void remove (const ObjectType &object)
 Remove object.
 
int removeIf (K0 k0, V0 v0, KeysValues... keysValues)
 Remove elements matching some particular key/value pair(s). More...
 
virtual void clear ()
 Clear the list.
 
virtual bool isEmpty () const
 Empty?
 
bool hasFilter () const
 Filter available.
 
void removeFilter ()
 Remove filter.
 
void takeFilterOwnership (std::unique_ptr< IModelFilter< ContainerType >> &filter)
 Set the filter.
 
void setSelectionModel (swift::gui::models::ISelectionModel< ContainerType > *selectionModel)
 Set the selection model.
 
QVariant data (const QModelIndex &index, int role) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) final
 
QMimeData * mimeData (const QModelIndexList &indexes) const final
 
void sort (int column, Qt::SortOrder order) final
 
int rowCount (const QModelIndex &parentIndex=QModelIndex()) const final
 
bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const final
 
bool dropMimeData (const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent) final
 
QJsonObject toJson (bool selectedOnly=false) const
 Convert to JSON. More...
 
QString toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented, bool selectedOnly=false) const
 Convert to JSON string. More...
 
bool isOrderable () const
 Orderable, normally use a container swift::misc::IOrderableList. More...
 
- Public Member Functions inherited from swift::gui::models::CListModelBaseNonTemplate
 ~CListModelBaseNonTemplate ()=default
 Destructor.
 
virtual swift::misc::CPropertyIndex columnToPropertyIndex (int column) const
 Column to property index.
 
virtual int propertyIndexToColumn (const swift::misc::CPropertyIndex &propertyIndex) const
 Property index to column number.
 
virtual swift::misc::CPropertyIndex modelIndexToPropertyIndex (const QModelIndex &index) const
 Index to property index.
 
virtual void setSortColumn (int column)
 Set sort column.
 
void setNoSorting ()
 Disable sorting.
 
void sortByPropertyIndex (const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder)
 Sort by index.
 
virtual bool setSortColumnByPropertyIndex (const swift::misc::CPropertyIndex &propertyIndex)
 Set column for sorting. More...
 
virtual bool setSorting (const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder)
 Sorting.
 
virtual int getSortColumn () const
 Get sort column property index.
 
swift::misc::CPropertyIndex getSortProperty () const
 Sorted by property.
 
virtual bool hasValidSortColumn () const
 Has valid sort column?
 
virtual Qt::SortOrder getSortOrder () const
 Get sort order.
 
void markDestroyed ()
 Mark as about to be destroyed, normally marked from view.
 
bool isModelDestroyed ()
 Model about to be destroyed?
 
virtual void clearHighlighting ()
 Remove all highlighting.
 
virtual bool hasHighlightedRows () const
 Has highlighted rows?
 
void setDropActions (Qt::DropActions dropActions)
 Drop actions.
 
void emitDataChanged (int startRowIndex, int endRowIndex)
 Send signal that data have been changed. More...
 
const CColumnsgetColumns () const
 The columns.
 
bool endsWithEmptyColumn () const
 Using void column at the end?
 
int columnCount (const QModelIndex &modelIndex=QModelIndex()) const final
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const final
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const final
 
QModelIndex parent (const QModelIndex &child) const final
 
Qt::ItemFlags flags (const QModelIndex &index) const final
 
Qt::DropActions supportedDragActions () const final
 
Qt::DropActions supportedDropActions () const final
 
QStringList mimeTypes () const final
 
- Public Member Functions inherited from swift::gui::CDropBase
virtual ~CDropBase ()
 Dtor.
 
void setAcceptedMetaTypeIds (const QList< int > &ids)
 Accepted ids.
 
void addAcceptedMetaTypeId (int id)
 Accepted ids.
 
virtual bool isDropAllowed () const
 Drop allowed?
 
virtual bool isJsonFileDropAllowed () const
 File drop allowed?
 
virtual void allowDrop (bool allowed)
 Drop allowed.
 
virtual void allowJsonFileDrop (bool allow)
 Allow JSON file drop.
 
bool acceptDrop (const QMimeData *mime) const
 Accept drop?
 
swift::misc::CVariant toCVariant (const QMimeData *mime) const
 Mime data to CVariant (normally encapsulating a value object)
 

Additional Inherited Members

- Public Types inherited from swift::gui::models::CListModelBase< swift::misc::CApplicationInfoList, true >
using ContainerType = swift::misc::CApplicationInfoList
 Container type.
 
using ObjectType = typename T::value_type
 Container element type.
 
- Signals inherited from swift::gui::models::CListModelBaseNonTemplate
void asyncUpdateFinished ()
 Asynchronous update finished.
 
void modelDataChanged (int count, bool withFilter)
 Data changed. More...
 
void modelDataChangedDigest (int count, bool withFilter)
 Data changed, digest version.
 
void changed ()
 Model has been changed Triggered with each change, for performance consider using changedDigest.
 
void changedDigest ()
 Model has been changed, digest signal.
 
void objectChanged (const swift::misc::CVariant &object, const swift::misc::CPropertyIndex &changedIndex)
 Template free information, that object changed.
 
- Static Public Attributes inherited from swift::gui::models::CListModelBaseNonTemplate
static constexpr int asyncThreshold = 50
 Number of elements when to use asynchronous updates.
 
- Protected Member Functions inherited from swift::gui::models::CListModelBase< swift::misc::CApplicationInfoList, true >
 CListModelBase (const QString &translationContext, QObject *parent=nullptr)
 Constructor.
 
void updateFilteredContainer ()
 Update filtered container.
 
void emitModelDataChanged ()
 Model changed.
 
void onDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomLeft, const QVector< int > &roles)
 Feedback when QStandardItemModel::dataChanged was called. More...
 
void onChangedDigest ()
 Feedback when QStandardItemModel::dataChanged was called. More...
 
- Protected Member Functions inherited from swift::gui::models::CListModelBaseNonTemplate
 CListModelBaseNonTemplate (const QString &translationContext, QObject *parent=nullptr)
 Constructor. More...
 
- Protected Member Functions inherited from swift::gui::CDropBase
 CDropBase ()
 Ctor.
 
- Protected Attributes inherited from swift::gui::models::CListModelBase< swift::misc::CApplicationInfoList, true >
ContainerType m_container
 used container
 
ContainerType m_containerFiltered
 cache for filtered container data
 
std::unique_ptr< IModelFilter< ContainerType > > m_filter
 used filter
 
ISelectionModel< ContainerType > * m_selectionModel
 selection model
 
- Protected Attributes inherited from swift::gui::models::CListModelBaseNonTemplate
CColumns m_columns
 columns metadata
 
int m_sortColumn
 currently sorted column
 
bool m_modelDestroyed = false
 
Qt::SortOrder m_sortOrder
 sort order (asc/desc)
 
Qt::DropActions m_dropActions = Qt::IgnoreAction
 drop actions
 
swift::misc::CPropertyIndexList m_sortTieBreakers
 how column values are sorted if equal, if no value is given this is random
 

Detailed Description

Application info list model.

Definition at line 20 of file applicationinfolistmodel.h.

Member Function Documentation

◆ otherSwiftVersionsFromDataDirectories()

void swift::gui::models::CApplicationInfoListModel::otherSwiftVersionsFromDataDirectories ( bool  reinit)

Filled from cache data directories.

Definition at line 37 of file applicationinfolistmodel.cpp.


The documentation for this class was generated from the following files: