Kstars

draglistbox.h
1 /*
2  SPDX-FileCopyrightText: 2005 Jason Harris <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QListWidget>
10 
11 class QDragEnterEvent;
12 class QDropEvent;
13 class 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  */
22 class DragListBox : public QListWidget
23 {
24  Q_OBJECT
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 };
Q_OBJECTQ_OBJECT
QObject * parent() const const
Extension of KListWidget that allows Drag-and-Drop with other DragListBoxes.
Definition: draglistbox.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:57:30 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.