diff --git a/python/PyQt6/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in b/python/PyQt6/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in index 001c87b03fc7..4173bd442647 100644 --- a/python/PyQt6/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in +++ b/python/PyQt6/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in @@ -128,16 +128,16 @@ an expression context for the editor when required. QgsMapLayer *layer() const; %Docstring -Returns the (possibly NULL) layer associated with the expression editor. +Returns the (possibly NULL) layer associated with the expression editor context. -.. versionadded:: 3.30 +.. versionadded:: 3.40 %End void setLayer( QgsMapLayer *layer ); %Docstring -Sets the ``layer`` to be used for in the expression editor context. +Sets the ``layer`` to be used associated with the expression editor context. -.. versionadded:: 3.30 +.. versionadded:: 3.40 %End signals: diff --git a/python/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in b/python/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in index 001c87b03fc7..4173bd442647 100644 --- a/python/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in +++ b/python/gui/auto_generated/tableeditor/qgstableeditordialog.sip.in @@ -128,16 +128,16 @@ an expression context for the editor when required. QgsMapLayer *layer() const; %Docstring -Returns the (possibly NULL) layer associated with the expression editor. +Returns the (possibly NULL) layer associated with the expression editor context. -.. versionadded:: 3.30 +.. versionadded:: 3.40 %End void setLayer( QgsMapLayer *layer ); %Docstring -Sets the ``layer`` to be used for in the expression editor context. +Sets the ``layer`` to be used associated with the expression editor context. -.. versionadded:: 3.30 +.. versionadded:: 3.40 %End signals: diff --git a/src/gui/layout/qgslayoutmanualtablewidget.cpp b/src/gui/layout/qgslayoutmanualtablewidget.cpp index aac4305bb6cc..19c8b429632b 100644 --- a/src/gui/layout/qgslayoutmanualtablewidget.cpp +++ b/src/gui/layout/qgslayoutmanualtablewidget.cpp @@ -18,6 +18,7 @@ #include "qgslayoutmanualtablewidget.h" #include "qgslayoutatlas.h" #include "qgslayout.h" +#include "qgslayoutreportcontext.h" #include "qgsprintlayout.h" #include "qgslayoutframe.h" #include "qgslayoutitemwidget.h" @@ -186,7 +187,7 @@ void QgsLayoutManualTableWidget::setTableContents() else { mEditorDialog = new QgsTableEditorDialog( this ); - if ( QgsLayout * layout =mTable->layout() ) + if ( QgsLayout *layout = mTable->layout() ) { mEditorDialog->setLayer( layout->reportContext().layer() ); } diff --git a/src/gui/tableeditor/qgstableeditordialog.cpp b/src/gui/tableeditor/qgstableeditordialog.cpp index 97fb361878cf..d767a6308745 100644 --- a/src/gui/tableeditor/qgstableeditordialog.cpp +++ b/src/gui/tableeditor/qgstableeditordialog.cpp @@ -21,6 +21,7 @@ #include "qgspanelwidgetstack.h" #include "qgstableeditorformattingwidget.h" #include "qgssettings.h" +#include "qgsmaplayer.h" #include #include @@ -154,7 +155,7 @@ void QgsTableEditorDialog::closeEvent( QCloseEvent * ) QgsMapLayer *QgsTableEditorDialog::layer() const { - return mLayer; + return mLayer.data(); } void QgsTableEditorDialog::setLayer( QgsMapLayer *layer ) diff --git a/src/gui/tableeditor/qgstableeditordialog.h b/src/gui/tableeditor/qgstableeditordialog.h index 76d7caf43b57..a789e747267f 100644 --- a/src/gui/tableeditor/qgstableeditordialog.h +++ b/src/gui/tableeditor/qgstableeditordialog.h @@ -19,6 +19,7 @@ #include "qgstablecell.h" #include "ui_qgstableeditorbase.h" #include +#include class QgsTableEditorWidget; class QgsMessageBar; @@ -144,14 +145,14 @@ class GUI_EXPORT QgsTableEditorDialog : public QMainWindow, private Ui::QgsTable void registerExpressionContextGenerator( QgsExpressionContextGenerator *generator ); /** - * Returns the (possibly NULL) layer associated with the expression editor. - * \since QGIS 3.30 + * Returns the (possibly NULL) layer associated with the expression editor context. + * \since QGIS 3.40 */ QgsMapLayer *layer() const; /** - * Sets the \a layer to be used for in the expression editor context. - * \since QGIS 3.30 + * Sets the \a layer to be used associated with the expression editor context. + * \since QGIS 3.40 */ void setLayer( QgsMapLayer *layer );