Skip to content

Commit 581e67e

Browse files
committed
support custom widgets in PYQT4_WRAP_UI
1 parent 442a3c1 commit 581e67e

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

cmake/PyQt4Macros.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,21 @@ ENDIF(NOT PYUIC4_PROGRAM)
2222

2323
# Adapted from QT4_WRAP_UI
2424
MACRO(PYQT4_WRAP_UI outfiles )
25+
IF(WIN32)
26+
SET(PYUIC4_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic4-wrapper.bat")
27+
SET(PYUIC4_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/bin/${CMAKE_BUILD_TYPE}")
28+
ELSE(WIN32)
29+
# TODO osx
30+
SET(PYUIC4_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic4-wrapper.sh")
31+
SET(PYUIC4_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/lib")
32+
ENDIF(WIN32)
33+
2534
FOREACH(it ${ARGN})
2635
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
2736
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
2837
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py)
2938
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
30-
COMMAND ${PYUIC4_PROGRAM} ${infile} -o ${outfile}
39+
COMMAND ${PYUIC4_WRAPPER} "${PYUIC4_PROGRAM}" "${PYUIC4_WRAPPER_PATH}" "${QGIS_OUTPUT_DIRECTORY}/python" ${infile} -o ${outfile}
3140
MAIN_DEPENDENCY ${infile}
3241
)
3342
SET(${outfiles} ${${outfiles}} ${outfile})

scripts/pyuic4-wrapper.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
set PYUIC4=%1
3+
set PATH=%2;%PATH%
4+
set PYTHONPATH=%3;%PYTHONPATH%
5+
%PYUIC4% %4 %5 %6 %7 %8 %9

scripts/pyuic4-wrapper.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
PYUIC4=$1
4+
LD_LIBRARY_PATH=$2:$LD_LIBRARY_PATH
5+
PYTHONPATH=$3:$PYTHONPATH
6+
shift 3
7+
8+
export LD_LIBRARY_PATH PYTHONPATH
9+
10+
$PYUIC4 $@

src/ui/qgsvectorlayerpropertiesbase.ui

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@
528528
</layout>
529529
<zorder>txtSubsetSQL</zorder>
530530
<zorder>pbnQueryBuilder</zorder>
531-
<zorder>collapseButton</zorder>
532531
</widget>
533532
</item>
534533
<item>

0 commit comments

Comments
 (0)