QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
18 #include <QMimeData>
19 
21 
22 QgsModelDesignerInputsTreeWidget::QgsModelDesignerInputsTreeWidget( QWidget *parent )
23  : QTreeWidget( parent )
24 {
25 
26 }
27 
28 QMimeData *QgsModelDesignerInputsTreeWidget::mimeData( const QList<QTreeWidgetItem *> items ) const
29 {
30  if ( items.empty() )
31  return nullptr;
32 
33  std::unique_ptr< QMimeData > res = qgis::make_unique< QMimeData >();
34  const QString text = items.value( 0 )->data( 0, Qt::UserRole ).toString();
35  res->setText( text );
36  return res.release();
37 }
38 
40 
qgsmodeldesignerinputstreewidget.h