Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+53
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Search Model for TableViews (has the ability to give the user a row for searching data)
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-03-14
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsDataView/lts_data_view_export.h>
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QSet>
|
||||
#include <QString>
|
||||
#include <QPointer>
|
||||
|
||||
|
||||
namespace LtsDataView
|
||||
{
|
||||
class LTSDATAVIEW_EXPORT SearchModel final : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SearchModel(QObject *parent = nullptr);
|
||||
|
||||
void setSourceModel(QAbstractItemModel* sourceModel);
|
||||
QAbstractItemModel *sourceModel() const { return m_sourceModel; }
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override final;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override final;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override final;
|
||||
int rowCount(const QModelIndex &parent) const override final;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role) override final;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override final;
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent) const override final;
|
||||
QModelIndex parent(const QModelIndex &child) const override final { (void)child; return QModelIndex(); }
|
||||
|
||||
signals:
|
||||
void stringFilterForColumnChanged(const QString &newFilterString, int column);
|
||||
void dataFilterForColumnChanged(const QVariant &newFilterData, int column);
|
||||
void signalFilterChanged();
|
||||
|
||||
private:
|
||||
QVariant m_searchIcon;
|
||||
QPointer<QAbstractItemModel> m_sourceModel;
|
||||
QHash<int, QVariant> m_columnFilters;
|
||||
QHash<int, QVariant> m_displayData;
|
||||
QHash<int, QVariant> m_comboBoxData;
|
||||
QSet<int> m_hideDecorationColumns;
|
||||
};
|
||||
} // namespace LtsDataView
|
||||
Reference in new issue
Block a user