Skip to content

Commit

Permalink
[PyQt5] make pyuic4-wrapper PyQt5 aware
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 10, 2016
1 parent aa29370 commit 264527a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/PyQtMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ MACRO(PYQT_WRAP_UI outfiles )
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYUIC_WRAPPER} "${PYUIC_PROGRAM}" "${PYUIC_WRAPPER_PATH}" "${QGIS_OUTPUT_DIRECTORY}/python" ${infile} -o ${outfile}
COMMAND ${PYUIC_WRAPPER} "${PYUIC_PROGRAM}" "${PYUIC_WRAPPER_PATH}" "${QGIS_OUTPUT_DIRECTORY}/python" "${PYTHON_EXECUTABLE}" ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
DEPENDS pygui pycore
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/pyuic4-wrapper.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set PYUIC4=%1
set PATH=%2;%PATH%
set PYTHONPATH=%3;%PYTHONPATH%
%PYUIC4% %4 %5 %6 %7 %8 %9
%PYUIC4% %5 %6 %7 %8 %9
5 changes: 4 additions & 1 deletion scripts/pyuic4-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
except:
pass

import PyQt4.uic.pyuic
try:
import PyQt4.uic.pyuic
except ImportError:
import PyQt5.uic.pyuic
5 changes: 3 additions & 2 deletions scripts/pyuic4-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
PYUIC4=$1
LD_LIBRARY_PATH=$2:$LD_LIBRARY_PATH
PYTHONPATH=$3:$PYTHONPATH
shift 3
PYTHON=$4
shift 4

export LD_LIBRARY_PATH PYTHONPATH

exec python $(dirname $0)/pyuic4-wrapper.py $@
exec $PYTHON $(dirname $0)/pyuic4-wrapper.py $@

0 comments on commit 264527a

Please sign in to comment.