19 #include <QSortFilterProxyModel>
29 explicit PrefsModel(QObject * parent = Q_NULLPTR);
33 Advanced = Qt::UserRole,
44 enum PrefsModelColumn {
52 QModelIndex index(
int row,
int column,
53 const QModelIndex & = QModelIndex())
const;
54 QModelIndex parent(
const QModelIndex &)
const;
55 QVariant data(
const QModelIndex &index,
int role)
const;
57 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
58 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
60 static QString typeToString(
int type);
61 static QString typeToHelp(
int type);
77 QString getName()
const {
return name_;}
78 pref_t* getPref()
const {
return pref_;}
79 int getPrefType()
const;
80 bool isPrefDefault()
const;
81 QString getPrefTypeName()
const;
82 module_t* getModule()
const {
return module_;}
83 QString getModuleName()
const;
84 QString getModuleTitle()
const;
85 QString getModuleHelp()
const;
86 void setChanged(
bool changed =
true);
105 enum AdvancedPrefsModelColumn {
113 virtual bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent)
const;
115 void setFilter(
const QString& filter);
116 void setShowChangedValues(
bool show_changed_values);
118 QVariant headerData(
int section, Qt::Orientation orientation,
119 int role = Qt::DisplayRole)
const;
120 QVariant data(
const QModelIndex &index,
int role)
const;
121 Qt::ItemFlags flags(
const QModelIndex &index)
const;
122 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
124 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
127 void setFirstColumnSpanned(QTreeView* tree,
const QModelIndex &index = QModelIndex());
130 bool filterAcceptItem(
PrefsItem& item)
const;
135 bool show_changed_values_;
136 const QChar passwordChar_;
145 enum ModulePrefsModelColumn {
150 enum ModulePrefsRoles {
151 ModuleName = Qt::UserRole + 1,
152 ModuleHelp = Qt::UserRole + 2
155 QVariant data(
const QModelIndex &index,
int role)
const;
156 Qt::ItemFlags flags(
const QModelIndex &index)
const;
157 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
159 virtual bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent)
const;
162 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right)
const;
166 QString advancedPrefName_;
169 extern pref_t *prefFromPrefPtr(
void *pref_ptr);
Definition: pref_models.h:99
Definition: tree_model_helpers.h:23
Definition: pref_models.h:140
Definition: pref_models.h:70
Definition: pref_models.h:25
Definition: prefs-int.h:27