aboutsummaryrefslogtreecommitdiffstats
path: root/tools/balsamui/inputlistview.h
blob: 899ebe1d8de99b67686ea7a65d4c50732b7b4787 (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-only WITH Qt-GPL-exception-1.0

#ifndef INPUTLISTVIEW_H
#define INPUTLISTVIEW_H

#include <QListWidget>

class InputListView : public QListWidget
{
public:
    InputListView(QWidget *parent = nullptr);
    bool tryAddItem(const QString &label);

protected:
    void dropEvent(QDropEvent *ev) override;
    void dragEnterEvent(QDragEnterEvent *ev) override;
    void dragMoveEvent(QDragMoveEvent *event) override;
    void dragLeaveEvent(QDragLeaveEvent *event) override;

private:
    bool containsItem(const QString &needle);
};

#endif