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
38public Q_SLOTS:
39 void slotScrollerStateChange(QScroller::State state){ KisKineticScroller::updateCursor(this, state); }
40
41Q_SIGNALS:
42
44
45Q_SIGNALS:
46
47 void currentResourceChanged(const QModelIndex &);
48 void currentResourceClicked(const QModelIndex &);
49
50 void contextMenuRequested(const QPoint &);
51
52protected:
53
55
56 void contextMenuEvent(QContextMenuEvent *event) override;
57 void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
58
59 void mousePressEvent(QMouseEvent *event) override;
60 bool viewportEvent(QEvent *event) override;
61
66 void resizeEvent(QResizeEvent *event) override;
67
68 void setViewMode(ViewMode mode);
69
70 void updateView();
71
72
73private Q_SLOTS:
74 void slotItemClicked(const QModelIndex &index);
75
76private:
78 QModelIndex m_beforeClickIndex;
80};
81
82#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)