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
Spacer widget for Drag&Drop attribute forms
- Loading branch information
Showing
17 changed files
with
359 additions
and
0 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
43 changes: 43 additions & 0 deletions
43
python/core/auto_generated/editform/qgsattributeeditorspacerelement.sip.in
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,43 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/editform/qgsattributeeditorspacerelement.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
class QgsAttributeEditorSpacerElement : QgsAttributeEditorElement | ||
{ | ||
%Docstring(signature="appended") | ||
An attribute editor widget that will represent a spacer. | ||
|
||
.. versionadded:: 3.30 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsattributeeditorspacerelement.h" | ||
%End | ||
public: | ||
|
||
QgsAttributeEditorSpacerElement( const QString &name, QgsAttributeEditorElement *parent ); | ||
%Docstring | ||
Creates a new element which represents a spacer | ||
|
||
:param name: The name of the widget | ||
:param parent: The parent (used as container) | ||
%End | ||
|
||
virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/; | ||
|
||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/editform/qgsattributeeditorspacerelement.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
51 changes: 51 additions & 0 deletions
51
python/gui/auto_generated/editorwidgets/qgsspacerwidgetwrapper.sip.in
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,51 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/editorwidgets/qgsspacerwidgetwrapper.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
class QgsSpacerWidgetWrapper : QgsWidgetWrapper | ||
{ | ||
%Docstring(signature="appended") | ||
Wraps a spacer widget. | ||
|
||
.. versionadded:: 3.30 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsspacerwidgetwrapper.h" | ||
%End | ||
public: | ||
|
||
explicit QgsSpacerWidgetWrapper( QgsVectorLayer *layer, QWidget *editor = 0, QWidget *parent = 0 ); | ||
%Docstring | ||
Create a new widget wrapper | ||
|
||
:param layer: The vector layer of the form the widget belongs to. | ||
:param editor: An editor widget. Can be ``None`` if one should be autogenerated. | ||
:param parent: A parent widget for this widget wrapper and the created widget. | ||
%End | ||
|
||
public: | ||
virtual bool valid() const; | ||
|
||
|
||
protected: | ||
virtual QWidget *createWidget( QWidget *parent ); | ||
|
||
|
||
public slots: | ||
virtual void setFeature( const QgsFeature &feature ); | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/editorwidgets/qgsspacerwidgetwrapper.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*************************************************************************** | ||
qgsattributeeditorspacerelement.cpp - QgsAttributeEditorSpacerElement | ||
--------------------- | ||
begin : 16.1.2023 | ||
copyright : (C) 2023 by Alessandro Pasotti | ||
email : elpaso at itopen dot it | ||
*************************************************************************** | ||
* * | ||
* 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 "qgsattributeeditorspacerelement.h" | ||
|
||
|
||
QgsAttributeEditorElement *QgsAttributeEditorSpacerElement::clone( QgsAttributeEditorElement *parent ) const | ||
{ | ||
return new QgsAttributeEditorSpacerElement( name(), parent ); | ||
} | ||
|
||
void QgsAttributeEditorSpacerElement::saveConfiguration( QDomElement &elem, QDomDocument &doc ) const | ||
{ | ||
// Nothing to save | ||
Q_UNUSED( elem ); | ||
Q_UNUSED( doc ); | ||
} | ||
|
||
void QgsAttributeEditorSpacerElement::loadConfiguration( const QDomElement &element, const QString &layerId, const QgsReadWriteContext &context, const QgsFields &fields ) | ||
{ | ||
// Nothing to load | ||
Q_UNUSED( element ); | ||
Q_UNUSED( layerId ); | ||
Q_UNUSED( context ); | ||
Q_UNUSED( fields ); | ||
} | ||
|
||
QString QgsAttributeEditorSpacerElement::typeIdentifier() const | ||
{ | ||
return QStringLiteral( "attributeEditorSpacerElement" ); | ||
} |
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,52 @@ | ||
/*************************************************************************** | ||
qgsattributeeditorspacerelement.h - QgsAttributeEditorSpacerElement | ||
--------------------- | ||
begin : 16.1.2023 | ||
copyright : (C) 2023 by Alessandro Pasotti | ||
email : elpaso at itopen dot it | ||
*************************************************************************** | ||
* * | ||
* 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 QGSATTRIBUTEEDITORSPACERELEMENT_H | ||
#define QGSATTRIBUTEEDITORSPACERELEMENT_H | ||
|
||
#include "qgsattributeeditorelement.h" | ||
#include "qgis_core.h" | ||
|
||
/** | ||
* \ingroup core | ||
* \brief An attribute editor widget that will represent a spacer. | ||
* | ||
* \since QGIS 3.30 | ||
*/ | ||
class CORE_EXPORT QgsAttributeEditorSpacerElement : public QgsAttributeEditorElement | ||
{ | ||
public: | ||
|
||
/** | ||
* Creates a new element which represents a spacer | ||
* | ||
* \param name The name of the widget | ||
* \param parent The parent (used as container) | ||
*/ | ||
QgsAttributeEditorSpacerElement( const QString &name, QgsAttributeEditorElement *parent ) | ||
: QgsAttributeEditorElement( AeTypeSpacerElement, name, parent ) | ||
{} | ||
|
||
QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const override SIP_FACTORY; | ||
|
||
|
||
// QgsAttributeEditorElement interface | ||
private: | ||
void saveConfiguration( QDomElement &elem, QDomDocument &doc ) const override; | ||
void loadConfiguration( const QDomElement &element, const QString &layerId, const QgsReadWriteContext &context, const QgsFields &fields ) override; | ||
QString typeIdentifier() const override; | ||
}; | ||
|
||
#endif // QGSATTRIBUTEEDITORSPACERELEMENT_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
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,39 @@ | ||
/*************************************************************************** | ||
qgsspacerwidgetwrapper.cpp - QgsSpacerWidgetWrapper | ||
--------------------- | ||
begin : 16.1.2023 | ||
copyright : (C) 2023 by Alessandro Pasotti | ||
email : elpaso at itopen dot it | ||
*************************************************************************** | ||
* * | ||
* 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 "qgsspacerwidgetwrapper.h" | ||
|
||
|
||
QgsSpacerWidgetWrapper::QgsSpacerWidgetWrapper( QgsVectorLayer *layer, QWidget *editor, QWidget *parent ) | ||
: QgsWidgetWrapper( layer, editor, parent ) | ||
{ | ||
|
||
} | ||
|
||
bool QgsSpacerWidgetWrapper::valid() const | ||
{ | ||
return true; | ||
} | ||
|
||
QWidget *QgsSpacerWidgetWrapper::createWidget( QWidget *parent ) | ||
{ | ||
return new QWidget( parent ); | ||
} | ||
|
||
void QgsSpacerWidgetWrapper::setFeature( const QgsFeature &feature ) | ||
{ | ||
Q_UNUSED( feature ); | ||
} |
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,52 @@ | ||
/*************************************************************************** | ||
qgsspacerwidgetwrapper.h - QgsSpacerWidgetWrapper | ||
--------------------- | ||
begin : 16.1.2023 | ||
copyright : (C) 2023 by Alessandro Pasotti | ||
email : elpaso at itopen dot it | ||
*************************************************************************** | ||
* * | ||
* 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 QGSSPACERWIDGETWRAPPER_H | ||
#define QGSSPACERWIDGETWRAPPER_H | ||
|
||
#include <qgswidgetwrapper.h> | ||
#include "qgis_gui.h" | ||
|
||
/** | ||
* \ingroup gui | ||
* \brief Wraps a spacer widget. | ||
* \since QGIS 3.30 | ||
*/ | ||
class GUI_EXPORT QgsSpacerWidgetWrapper : public QgsWidgetWrapper | ||
{ | ||
Q_OBJECT | ||
public: | ||
|
||
/** | ||
* Create a new widget wrapper | ||
* | ||
* \param layer The vector layer of the form the widget belongs to. | ||
* \param editor An editor widget. Can be NULLPTR if one should be autogenerated. | ||
* \param parent A parent widget for this widget wrapper and the created widget. | ||
*/ | ||
explicit QgsSpacerWidgetWrapper( QgsVectorLayer *layer, QWidget *editor = nullptr, QWidget *parent = nullptr ); | ||
|
||
// QgsWidgetWrapper interface | ||
public: | ||
bool valid() const override; | ||
|
||
protected: | ||
QWidget *createWidget( QWidget *parent ) override; | ||
|
||
public slots: | ||
void setFeature( const QgsFeature &feature ) override; | ||
}; | ||
|
||
#endif // QGSSPACERWIDGETWRAPPER_H |
Oops, something went wrong.