Krita Source Code Documentation
Loading...
Searching...
No Matches
dlg_bundle_manager.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Victor Lafon metabolic.ewilan @hotmail.fr
3 * SPDX-FileCopyrightText: 2023 Srirupa Datta <srirupa.sps@gmail.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7#ifndef DLG_BUNDLE_MANAGER_H
8#define DLG_BUNDLE_MANAGER_H
9
10#include <KoDialog.h>
11#include <QModelIndex>
12#include <QPersistentModelIndex>
13#include <QStyledItemDelegate>
14#include <QWidget>
15
16#include "ui_wdgdlgbundlemanager.h"
17
18class KisStorageModel;
20
21class WdgDlgBundleManager : public QWidget, public Ui::WdgDlgBundleManager
22{
23 Q_OBJECT
24
25public:
26 WdgDlgBundleManager(QWidget *parent)
27 : QWidget(parent)
28 {
29 setupUi(this);
30 }
31};
32
34{
35 Q_OBJECT
36public:
37
38 class ItemDelegate : public QStyledItemDelegate
39 {
40 public:
41
43 QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const override;
44 void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override;
45
46 private:
48
49 };
50
51 explicit DlgBundleManager(QWidget *parent = 0);
52
53public Q_SLOTS:
54 void done(int res) override;
55
56private Q_SLOTS:
57
58 void addBundle();
59 void createBundle();
60 void toggleBundle();
61 void editBundle();
62
64 void slotModelReset();
65 void slotRowsRemoved(const QModelIndex &parent, int first, int last);
66 void slotRowsInserted(const QModelIndex &parent, int first, int last);
67
68 void currentCellSelectedChanged(QModelIndex current, QModelIndex previous);
69
70private:
71
72 void updateToggleButton(bool active);
73 void updateBundleInformation(QModelIndex idx);
74
76 QPersistentModelIndex lastIndex;
78
79};
80
81#endif // DLG_BUNDLE_MANAGER_H
ItemDelegate(QObject *, KisStorageFilterProxyModel *)
KisStorageFilterProxyModel * m_bundleManagerProxyModel
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
void slotRowsRemoved(const QModelIndex &parent, int first, int last)
WdgDlgBundleManager * m_ui
void done(int res) override
void updateBundleInformation(QModelIndex idx)
KisStorageFilterProxyModel * m_proxyModel
QPersistentModelIndex lastIndex
void currentCellSelectedChanged(QModelIndex current, QModelIndex previous)
DlgBundleManager(QWidget *parent=0)
void updateToggleButton(bool active)
void slotRowsInserted(const QModelIndex &parent, int first, int last)
A dialog base class with standard buttons and predefined layouts.
Definition KoDialog.h:116
QSize sizeHint() const override
Definition KoDialog.cpp:377
WdgDlgBundleManager(QWidget *parent)