Krita Source Code Documentation
Loading...
Searching...
No Matches
KisResourceItemView.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
3 * SPDX-FileCopyrightText: 2011 José Luis Vergara <pentalis@gmail.com>
4 * SPDX-FileCopyrightText: 2018 Boudewijn Rempt <boud@valdyas.org>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8
9#ifndef KISRESOURCEITEMVIEW_H
10#define KISRESOURCEITEMVIEW_H
11
12#include <QTableView>
13#include <QScroller>
14
15#include <KisKineticScroller.h>
16
17#include "KisIconToolTip.h"
18
19class QEvent;
20class QModelIndex;
21
22#include "kritaresourcewidgets_export.h"
23
25class KRITARESOURCEWIDGETS_EXPORT KisResourceItemView : public QTableView
26{
27 Q_OBJECT
28
29public:
30
31 enum ViewMode {
33 FIXED_ROWS
34 };
35
36 explicit KisResourceItemView(QWidget *parent = 0);
37 ~KisResourceItemView() override { disconnect(); }
38
39public Q_SLOTS:
40 void slotScrollerStateChange(QScroller::State state){ KisKineticScroller::updateCursor(this, state); }
41
42Q_SIGNALS:
43
45
46Q_SIGNALS:
47
48 void currentResourceChanged(const QModelIndex &);
49 void currentResourceClicked(const QModelIndex &);
50
51 void contextMenuRequested(const QPoint &);
52
53protected:
54
56
57 void contextMenuEvent(QContextMenuEvent *event) override;
58 void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
59
60 void mousePressEvent(QMouseEvent *event) override;
61 bool viewportEvent(QEvent *event) override;
62
67 void resizeEvent(QResizeEvent *event) override;
68
69 void setViewMode(ViewMode mode);
70
71 void updateView();
72
73
74private Q_SLOTS:
75 void slotItemClicked(const QModelIndex &index);
76
77private:
79 QModelIndex m_beforeClickIndex;
81};
82
83#endif // KISRESOURCEITEMVIEW_H
The resource view.
void currentResourceClicked(const QModelIndex &)
void currentResourceChanged(const QModelIndex &)
void contextMenuRequested(const QPoint &)
void slotScrollerStateChange(QScroller::State state)
KRITAWIDGETUTILS_EXPORT void updateCursor(QWidget *source, QScroller::State state)