QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsmodeldesignerinputstreewidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsmodeldesignerinputstreewidget.cpp
3 ------------------------
4 Date : March 2020
5 Copyright : (C) 2020 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17#include "moc_qgsmodeldesignerinputstreewidget.cpp"
18
19#include <QMimeData>
20
22
23QgsModelDesignerInputsTreeWidget::QgsModelDesignerInputsTreeWidget( QWidget *parent )
24 : QTreeWidget( parent )
25{
26
27}
28
29#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
30QMimeData *QgsModelDesignerInputsTreeWidget::mimeData( const QList<QTreeWidgetItem *> items ) const
31#else
32QMimeData *QgsModelDesignerInputsTreeWidget::mimeData( const QList<QTreeWidgetItem *> &items ) const
33#endif
34{
35 if ( items.empty() )
36 return nullptr;
37
38 std::unique_ptr< QMimeData > res = std::make_unique< QMimeData >();
39 const QString text = items.value( 0 )->data( 0, Qt::UserRole ).toString();
40 res->setText( text );
41 return res.release();
42}
43
45