6#ifndef SWIFT_GUI_MODELS_LISTMODELBASENONTEMPLATE_H
7#define SWIFT_GUI_MODELS_LISTMODELBASENONTEMPLATE_H
9#include <QJsonDocument>
12#include <QStandardItemModel>
18#include "gui/dropbase.h"
107 virtual bool hasValidSortColumn()
const;
132 void emitDataChanged(
int startRowIndex,
int endRowIndex);
139 bool selectedOnly =
false)
const = 0;
193 std::chrono::milliseconds(500), 10 };
Qt::DropActions m_dropActions
drop actions
void setDropActions(Qt::DropActions dropActions)
Drop actions.
bool endsWithEmptyColumn() const
Using void column at the end?
Qt::DropActions supportedDragActions() const final
QStringList mimeTypes() const final
virtual Qt::SortOrder getSortOrder() const
Get sort order.
virtual bool hasHighlightedRows() const
Has highlighted rows?
Qt::ItemFlags flags(const QModelIndex &index) const final
~CListModelBaseNonTemplate()=default
Destructor.
void objectChanged(const swift::misc::CVariant &object, const swift::misc::CPropertyIndex &changedIndex)
Template free information, that object changed.
virtual void clearHighlighting()
Remove all highlighting.
virtual void onChangedDigest()=0
Digest signal.
static constexpr int asyncThreshold
Number of elements when to use asynchronous updates.
virtual void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)=0
Feedback when QStandardItemModel::dataChanged was called.
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.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const final
void modelDataChanged(int count, bool withFilter)
Data changed.
QModelIndex parent(const QModelIndex &child) const final
virtual swift::misc::CPropertyIndex columnToPropertyIndex(int column) const
Column to property index.
void markDestroyed()
Mark as about to be destroyed, normally marked from view.
CListModelBaseNonTemplate(const QString &translationContext, QObject *parent=nullptr)
Constructor.
swift::misc::CPropertyIndexList m_sortTieBreakers
how column values are sorted if equal, if no value is given this is random
QVariant headerData(int section, Qt::Orientation orientation, int role) const final
virtual void setSortColumn(int column)
Set sort column.
const CColumns & getColumns() const
The columns.
void asyncUpdateFinished()
Asynchronous update finished.
void changedDigest()
Model has been changed, digest signal.
virtual QString toJsonString(QJsonDocument::JsonFormat format=QJsonDocument::Indented, bool selectedOnly=false) const =0
Convert to JSON string.
int m_sortColumn
currently sorted column
void setNoSorting()
Disable sorting.
bool isModelDestroyed()
Model about to be destroyed?
virtual QJsonObject toJson(bool selectedOnly=false) const =0
Convert to JSON.
Qt::DropActions supportedDropActions() const final
virtual int getSortColumn() const
Get sort column property index.
CColumns m_columns
columns metadata
virtual bool isOrderable() const =0
Orderable, normally use a container swift::misc::IOrderableList.
virtual swift::misc::CPropertyIndex modelIndexToPropertyIndex(const QModelIndex &index) const
Index to property index.
Qt::SortOrder m_sortOrder
sort order (asc/desc)
virtual int propertyIndexToColumn(const swift::misc::CPropertyIndex &propertyIndex) const
Property index to column number.
int columnCount(const QModelIndex &modelIndex=QModelIndex()) const final
Receive 1..n signals, collect them over time, and resend afer n milliseconds.
Value object encapsulating a list of property indexes.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Class for doing some arbitrary parcel of work in its own thread.
Models to be used with views, mainly QTableView.
Free functions in swift::misc.
QStandardItemModel(QObject *parent)
#define SWIFT_GUI_EXPORT
Export a class or function from the library.