Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
More c++ ports
- Loading branch information
1 parent
df7dd5b
commit 8845b53
Showing
8 changed files
with
133 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/gui/processing/models/qgsmodeldesignerinputstreewidget.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*************************************************************************** | ||
qgsmodeldesignerinputstreewidget.cpp | ||
------------------------ | ||
Date : March 2020 | ||
Copyright : (C) 2020 Nyall Dawson | ||
Email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsmodeldesignerinputstreewidget.h" | ||
|
||
#include <QMimeData> | ||
|
||
///@cond NOT_STABLE | ||
|
||
QgsModelDesignerInputsTreeWidget::QgsModelDesignerInputsTreeWidget( QWidget *parent ) | ||
: QTreeWidget( parent ) | ||
{ | ||
|
||
} | ||
|
||
QMimeData *QgsModelDesignerInputsTreeWidget::mimeData( const QList<QTreeWidgetItem *> items ) const | ||
{ | ||
if ( items.empty() ) | ||
return nullptr; | ||
|
||
std::unique_ptr< QMimeData > res = qgis::make_unique< QMimeData >(); | ||
const QString text = items.value( 0 )->data( 0, Qt::UserRole ).toString(); | ||
res->setText( text ); | ||
return res.release(); | ||
} | ||
|
||
///@endcond | ||
|
49 changes: 49 additions & 0 deletions
49
src/gui/processing/models/qgsmodeldesignerinputstreewidget.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*************************************************************************** | ||
qgsmodeldesignerinputstreewidget.h | ||
------------------------ | ||
Date : March 2020 | ||
Copyright : (C) 2020 Nyall Dawson | ||
Email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSMODELDESIGNERINPUTSTREEWIDGET_H | ||
#define QGSMODELDESIGNERINPUTSTREEWIDGET_H | ||
|
||
#include "qgis.h" | ||
#include "qgis_gui.h" | ||
#include <QTreeWidget> | ||
|
||
class QMimeData; | ||
|
||
#define SIP_NO_FILE | ||
|
||
///@cond NOT_STABLE | ||
|
||
/** | ||
* \ingroup gui | ||
* \brief QTreeWidget subclass for use in the model designer as an input list. | ||
* \warning Not stable API | ||
* \since QGIS 3.14 | ||
*/ | ||
class QgsModelDesignerInputsTreeWidget : public QTreeWidget | ||
{ | ||
public: | ||
|
||
/** | ||
* Constructor for QgsModelDesignerInputsTreeWidget with the specified \a parent widget. | ||
*/ | ||
explicit QgsModelDesignerInputsTreeWidget( QWidget *parent = nullptr ); | ||
|
||
QMimeData *mimeData( const QList<QTreeWidgetItem *> items ) const override; | ||
}; | ||
|
||
///@endcond | ||
|
||
#endif // QGSMODELDESIGNERINPUTSTREEWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters