Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix QgsLayoutChecker::testLayout python bindings
  • Loading branch information
nyalldawson committed May 10, 2023
1 parent 5ed627e commit f1c0923
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions python/core/auto_generated/qgsmultirenderchecker.sip.in
Expand Up @@ -169,7 +169,7 @@ Constructor for QgsLayoutChecker.
Sets the output (reference) image ``size``.
%End

bool testLayout( QString &report, int page = 0, int pixelDiff = 0, bool createReferenceImage = false );
bool testLayout( QString &report /Out/, int page = 0, int pixelDiff = 0, bool createReferenceImage = false );
%Docstring
Runs a render check on the layout, adding results to the specified ``report``.

Expand All @@ -182,7 +182,12 @@ in this case the test will always return ``True``.
The page number is specified via ``page``, where 0 corresponds to the first
page in the layout.

Returns ``False`` if the rendered layout differs from the expected reference image.
:param page: page number from layout to render and check
:param pixelDiff: number of pixels which are permitted to differ from reference image.
:param createReferenceImage: if ``True``, the rendered reference image will be regenerated instead of performing a comparison test with the existing image

:return: - ``True`` if the rendered layout matches the expected reference image.
- report: will be set to generated test report
%End

};
Expand Down
9 changes: 7 additions & 2 deletions src/core/qgsmultirenderchecker.h
Expand Up @@ -197,9 +197,14 @@ class CORE_EXPORT QgsLayoutChecker : public QgsMultiRenderChecker
* The page number is specified via \a page, where 0 corresponds to the first
* page in the layout.
*
* Returns FALSE if the rendered layout differs from the expected reference image.
* \param report will be set to generated test report
* \param page page number from layout to render and check
* \param pixelDiff number of pixels which are permitted to differ from reference image.
* \param createReferenceImage if TRUE, the rendered reference image will be regenerated instead of performing a comparison test with the existing image
*
* \returns TRUE if the rendered layout matches the expected reference image.
*/
bool testLayout( QString &report, int page = 0, int pixelDiff = 0, bool createReferenceImage = false );
bool testLayout( QString &report SIP_OUT, int page = 0, int pixelDiff = 0, bool createReferenceImage = false );

private:
QgsLayoutChecker() = delete;
Expand Down

0 comments on commit f1c0923

Please sign in to comment.