Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
settings_search_delegate.h
Go to the documentation of this file.
1
6#ifndef COCKATRICE_SETTINGS_SEARCH_DELEGATE_H
7#define COCKATRICE_SETTINGS_SEARCH_DELEGATE_H
8
9#include <QPixmap>
10#include <QStyledItemDelegate>
11
18class SettingsSearchDelegate : public QStyledItemDelegate
19{
20 Q_OBJECT
21public:
22 explicit SettingsSearchDelegate(QObject *parent = nullptr);
23
24 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
25 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
26
28 void setPageNames(const QStringList &names);
29
31 void setPageIcons(const QStringList &iconResources);
32
33private:
34 QStringList pageNames;
35 QList<QPixmap> pageIcons;
36};
37
38#endif // COCKATRICE_SETTINGS_SEARCH_DELEGATE_H
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition settings_search_delegate.cpp:121
void setPageNames(const QStringList &names)
Sets the translated page names for breadcrumb display.
Definition settings_search_delegate.cpp:16
QStringList pageNames
Translated page names indexed by page position.
Definition settings_search_delegate.h:34
void setPageIcons(const QStringList &iconResources)
Sets the icons shown in front of results, indexed by page position.
Definition settings_search_delegate.cpp:21
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition settings_search_delegate.cpp:29
QList< QPixmap > pageIcons
Icons of the related settings pages.
Definition settings_search_delegate.h:35
SettingsSearchDelegate(QObject *parent=nullptr)
Definition settings_search_delegate.cpp:12