aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/eventlist/nodelistdelegate.h
blob: 9e2db1a664989be29137dfdcca0c6f146054d9de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once

#include <QStyledItemDelegate>

namespace QmlDesigner {

class NodeListDelegate : public QStyledItemDelegate
{
    Q_OBJECT

public:
    NodeListDelegate(QObject *parent = nullptr);
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;

protected:
    bool eventFilter(QObject *editor, QEvent *event) override;

private:
    void close();
    void commitAndClose();
};

} // namespace QmlDesigner.