Kstars

draglistbox.h
1/*
2 SPDX-FileCopyrightText: 2005 Jason Harris <kstars@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QListWidget>
10
11class QDragEnterEvent;
12class QDropEvent;
13class QMouseEvent;
14
15/**
16 * @class DragListBox
17 * @short Extension of KListWidget that allows Drag-and-Drop with other DragListBoxes
18 *
19 * @author Jason Harris
20 * @version 1.0
21 */
23{
25 public:
26 explicit DragListBox(QWidget *parent = nullptr, const char *name = nullptr);
27
28 int ignoreIndex() const { return IgnoreIndex; }
29 bool contains(const QString &s) const;
30
31 void dragEnterEvent(QDragEnterEvent *evt) override;
32 void dragMoveEvent(QDragMoveEvent *evt) override;
33 void dropEvent(QDropEvent *evt) override;
34 void mousePressEvent(QMouseEvent *evt) override;
35 void mouseMoveEvent(QMouseEvent *) override;
36 void mouseReleaseEvent(QMouseEvent *) override;
37
38 private:
39 bool leftButtonDown { false };
40 int IgnoreIndex { 0 };
41};
Extension of KListWidget that allows Drag-and-Drop with other DragListBoxes.
Definition draglistbox.h:23
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.