File indexing completed on 2025-01-19 03:57:44
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2010-03-06 0007 * Description : sub class of QTreeWidget for drag-and-drop support 0008 * 0009 * SPDX-FileCopyrightText: 2010 by Michael G. Hansen <mike at mghansen dot de> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_GEO_MY_TREE_WIDGET_H 0016 #define DIGIKAM_GEO_MY_TREE_WIDGET_H 0017 0018 // Qt includes 0019 0020 #include <QTreeWidget> 0021 #include <QPersistentModelIndex> 0022 0023 // local includes 0024 0025 #include "myimageitem.h" 0026 0027 class QMouseEvent; 0028 0029 Q_DECLARE_METATYPE(QTreeWidgetItem*) 0030 0031 class MyTreeWidget : public QTreeWidget 0032 { 0033 Q_OBJECT 0034 0035 public: 0036 0037 explicit MyTreeWidget(QWidget* const parent = nullptr); 0038 ~MyTreeWidget() override; 0039 0040 protected: 0041 0042 void startDrag(Qt::DropActions supportedActions) override; 0043 0044 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 0045 0046 QMimeData* mimeData(const QList<QTreeWidgetItem*>& items) const override; 0047 0048 #else 0049 0050 // cppcheck-suppress passedByValue 0051 QMimeData* mimeData(const QList<QTreeWidgetItem*> items) const override; // clazy:exclude=function-args-by-ref 0052 0053 #endif 0054 0055 // cppcheck-suppress passedByValue 0056 virtual QMimeData* mimeData(const QModelIndexList items) const; 0057 0058 private: 0059 0060 class Private; 0061 Private* const d; 0062 }; 0063 0064 #endif // DIGIKAM_GEO_MY_TREE_WIDGET_H