Add interface class QgsFileFilterGenerator for classes which can generate a file filter string

This commit is contained in:
Nyall Dawson 2020-03-15 11:46:04 +10:00
parent 62112ac911
commit 51f40f7180
4 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,45 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfilefiltergenerator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFileFilterGenerator
{
%Docstring
Abstract interface for classes which generate a file filter string.
This interface can be inherited by classes which can generate a file filter
string, for use in file open or file save dialogs.
.. versionadded:: 3.14
%End
%TypeHeaderCode
#include "qgsfilefiltergenerator.h"
%End
public:
virtual ~QgsFileFilterGenerator();
virtual QString createFileFilter() const = 0;
%Docstring
This method needs to be reimplemented in all classes which implement this interface
and return a file filter.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfilefiltergenerator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -77,6 +77,7 @@
%Include auto_generated/qgsfieldproxymodel.sip
%Include auto_generated/qgsfields.sip
%Include auto_generated/qgsfiledownloader.sip
%Include auto_generated/qgsfilefiltergenerator.sip
%Include auto_generated/qgsfileutils.sip
%Include auto_generated/qgsfontutils.sip
%Include auto_generated/qgsgeometryoptions.sip

View File

@ -776,6 +776,7 @@ SET(QGIS_CORE_HDRS
qgsfieldproxymodel.h
qgsfields.h
qgsfiledownloader.h
qgsfilefiltergenerator.h
qgsfileutils.h
qgsfontutils.h
qgsgdalutils.h

View File

@ -0,0 +1,48 @@
/***************************************************************************
qgsfilefiltergenerator.h
------------------------
begin : March 2020
copyright : (C) 2020 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 QGSFILEFILTERGENERATOR_H
#define QGSFILEFILTERGENERATOR_H
#include "qgis_core.h"
#include <QString>
/**
* \ingroup core
* Abstract interface for classes which generate a file filter string.
*
* This interface can be inherited by classes which can generate a file filter
* string, for use in file open or file save dialogs.
*
* \since QGIS 3.14
*/
class CORE_EXPORT QgsFileFilterGenerator
{
public:
virtual ~QgsFileFilterGenerator() = default;
/**
* This method needs to be reimplemented in all classes which implement this interface
* and return a file filter.
*/
virtual QString createFileFilter() const = 0;
};
#endif // QGSPROCESSINGUTILS_H