-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom drop handlers for layout windows
- Loading branch information
1 parent
b0dea08
commit eea36c0
Showing
13 changed files
with
281 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/layout/qgslayoutcustomdrophandler.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsLayoutCustomDropHandler : QObject | ||
{ | ||
%Docstring | ||
Abstract base class that may be implemented to handle new types of data to be dropped in QGIS layouts. | ||
|
||
.. versionadded:: 3.0 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgslayoutcustomdrophandler.h" | ||
%End | ||
public: | ||
virtual ~QgsLayoutCustomDropHandler(); | ||
|
||
virtual bool handleFileDrop( const QString &file ); | ||
%Docstring | ||
Called when the specified ``file`` has been dropped onto a QGIS layout. If true | ||
is returned, then the handler has accepted this file and it should not | ||
be further processed (e.g. by other QgsLayoutCustomDropHandler). | ||
|
||
The base class implementation does nothing. | ||
:rtype: bool | ||
%End | ||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/layout/qgslayoutcustomdrophandler.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/*************************************************************************** | ||
qgslayoutcustomdrophandler.cpp | ||
------------------------------ | ||
begin : December 2017 | ||
copyright : (C) 2017 by 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 "qgslayoutcustomdrophandler.h" | ||
|
||
bool QgsLayoutCustomDropHandler::handleFileDrop( const QString &file ) | ||
{ | ||
Q_UNUSED( file ); | ||
return false; | ||
} |
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,45 @@ | ||
/*************************************************************************** | ||
qgslayoutcustomdrophandler.h | ||
--------------------- | ||
begin : December 2017 | ||
copyright : (C) 2017 by 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 QGSLAYOUTCUSTOMDROPHANDLER_H | ||
#define QGSLAYOUTCUSTOMDROPHANDLER_H | ||
|
||
#include "qgis_gui.h" | ||
#include <QObject> | ||
|
||
/** | ||
* \ingroup gui | ||
* Abstract base class that may be implemented to handle new types of data to be dropped in QGIS layouts. | ||
* | ||
* \since QGIS 3.0 | ||
*/ | ||
class GUI_EXPORT QgsLayoutCustomDropHandler : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
virtual ~QgsLayoutCustomDropHandler() = default; | ||
|
||
/** | ||
* Called when the specified \a file has been dropped onto a QGIS layout. If true | ||
* is returned, then the handler has accepted this file and it should not | ||
* be further processed (e.g. by other QgsLayoutCustomDropHandler). | ||
* | ||
* The base class implementation does nothing. | ||
*/ | ||
virtual bool handleFileDrop( const QString &file ); | ||
}; | ||
|
||
#endif // QGSLAYOUTCUSTOMDROPHANDLER_H |
Oops, something went wrong.
eea36c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this commit, I can't compile master on MacOS:
For the error line L 1263, missing variable.
But for the block between L 948 and L 980, I don't know which library is missing to get compilation working again.
CC @dakcarto
eea36c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe these includes help: https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp#L117
eea36c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It works now.
I will make a PR