File indexing completed on 2024-04-14 04:53:07
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2002 John Firebaugh <jfirebaugh@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef KONQDRAGGABLELABEL_H 0007 #define KONQDRAGGABLELABEL_H 0008 0009 #include <QUrl> 0010 #include <QLabel> 0011 class KonqMainWindow; 0012 0013 class KonqDraggableLabel : public QLabel 0014 { 0015 Q_OBJECT 0016 public: 0017 KonqDraggableLabel(KonqMainWindow *mw, const QString &text); 0018 0019 protected: 0020 void mousePressEvent(QMouseEvent *ev) override; 0021 void mouseMoveEvent(QMouseEvent *ev) override; 0022 void mouseReleaseEvent(QMouseEvent *) override; 0023 void dragEnterEvent(QDragEnterEvent *ev) override; 0024 void dropEvent(QDropEvent *ev) override; 0025 0026 private Q_SLOTS: 0027 void delayedOpenURL(); 0028 0029 private: 0030 QPoint startDragPos; 0031 bool validDrag; 0032 KonqMainWindow *m_mw; 0033 QList<QUrl> _savedLst; 0034 }; 0035 #endif