Krita Source Code Documentation
Loading...
Searching...
No Matches
KisResourceItemListView.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2019 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KISRESOURCEITEMLISTVIEW_H
8#define KISRESOURCEITEMLISTVIEW_H
9
10#include <QListView>
11#include <QScopedPointer>
12
13#include <KisKineticScroller.h>
14
15#include "kritaresourcewidgets_export.h"
17
18
19class KRITARESOURCEWIDGETS_EXPORT KisResourceItemListView : public QListView
20{
21 Q_OBJECT
22
23public:
24 KisResourceItemListView(QWidget *parent = nullptr);
25 ~KisResourceItemListView() override;
26
27 void setListViewMode(ListViewMode layout);
28
35 void setItemSize(QSize size);
36
47 void setStrictSelectionMode(bool enable);
48
49 void setFixedToolTipThumbnailSize(const QSize &size);
50 void setToolTipShouldRenderCheckers(bool value);
51
52public Q_SLOTS:
53 void slotScrollerStateChange(QScroller::State state){ KisKineticScroller::updateCursor(this, state); }
54
55Q_SIGNALS:
56
58
59 void currentResourceChanged(const QModelIndex &);
60 void currentResourceClicked(const QModelIndex &);
61
62 void contextMenuRequested(const QPoint &);
63
64protected Q_SLOTS:
65 void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
66 void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
67
68protected:
69 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &index, const QEvent *event = nullptr) const override;
70 void contextMenuEvent(QContextMenuEvent *event) override;
71
72 bool viewportEvent(QEvent *event) override;
73
74private:
75 void resizeEvent(QResizeEvent *event) override;
76
77private:
78 struct Private;
79 const QScopedPointer<Private> m_d;
80};
81
82#endif // KISRESOURCEITEMLISTVIEW_H
float value(const T *src, size_t ch)
KRITAWIDGETUTILS_EXPORT void updateCursor(QWidget *source, QScroller::State state)
void currentResourceClicked(const QModelIndex &)
void slotScrollerStateChange(QScroller::State state)
void currentResourceChanged(const QModelIndex &)
const QScopedPointer< Private > m_d
void contextMenuRequested(const QPoint &)