summaryrefslogtreecommitdiffstats
path: root/src/widgets/Qt6WidgetsMacros.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-31 15:56:00 +1000
committerCraig Scott <craig.scott@qt.io>2021-08-31 17:05:15 +1000
commit08180e76e6116f0ef66476ca00b2b676b3aa50da (patch)
treecb661ebcfd916457064982c0346deef661aa8570 /src/widgets/Qt6WidgetsMacros.cmake
parentd54d91c0ad42ec831d3b4e01f66b6bd61010c8d6 (diff)
Ensure versionless wrappers do not introduce a new variable scope
Using function instead of macro prevented the wrappers from being able to pass back any variables set in the wrapped function. In some cases, these variables were being explicitly passed back to the caller, but that isn't needed if you just make each wrapper a macro. This also makes things more future-proof because any newly introduced output variables will work without having to update the wrappers. Task-number: QTBUG-96121 Pick-to: 6.2 Change-Id: Ic4486de668694c06b47e466587b2cdcb969ea047 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/widgets/Qt6WidgetsMacros.cmake')
-rw-r--r--src/widgets/Qt6WidgetsMacros.cmake9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/widgets/Qt6WidgetsMacros.cmake b/src/widgets/Qt6WidgetsMacros.cmake
index aa8133ba47..615e3ee695 100644
--- a/src/widgets/Qt6WidgetsMacros.cmake
+++ b/src/widgets/Qt6WidgetsMacros.cmake
@@ -70,12 +70,11 @@ endfunction()
# This will override the CMake upstream command, because that one is for Qt 3.
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_wrap_ui outfiles)
+ macro(qt_wrap_ui)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
- qt5_wrap_ui("${outfiles}" ${ARGN})
+ qt5_wrap_ui(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
- qt6_wrap_ui("${outfiles}" ${ARGN})
+ qt6_wrap_ui(${ARGV})
endif()
- set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
- endfunction()
+ endmacro()
endif()