KNewStuff

searchpresetmodel.h
1/*
2 SPDX-FileCopyrightText: 2021 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef SEARCHPRESETMODEL_H
8#define SEARCHPRESETMODEL_H
9
10#include "enginebase.h"
11
12#include <QAbstractListModel>
13
14/**
15 * @brief The SearchPresetModel class
16 *
17 * this class handles search presets.
18 * @since 5.83
19 */
21{
23public:
25 ~SearchPresetModel() override;
26
27 enum Roles {
28 DisplayNameRole = Qt::UserRole + 1,
29 IconRole,
30 };
31 Q_ENUM(Roles)
32
33 QHash<int, QByteArray> roleNames() const override;
34
35 QVariant data(const QModelIndex &index, int role = DisplayNameRole) const override;
36 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
37
38 Q_INVOKABLE void loadSearch(const QModelIndex &index);
39
40private:
41 KNSCore::EngineBase *const m_engine;
42};
43
44#endif // SEARCHPRESETMODEL_H
KNewStuff engine.
Definition enginebase.h:52
The SearchPresetModel class.
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_ENUM(...)
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
QObject * parent() const const
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:54:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.