Skip to content

Commit

Permalink
fix bug with pyside2 in cmake and qtoptions, fix deprecated exec_()
Browse files Browse the repository at this point in the history
  • Loading branch information
alfiTH committed Feb 25, 2025
1 parent bcb48af commit 71a9ee5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MACRO( WRAP_PYTHON_UI )
FOREACH( input_file $${ARGN} )
ADD_CUSTOM_COMMAND (
OUTPUT src/ui_$${input_file}.py
COMMAND pyside2-uic $${CMAKE_CURRENT_SOURCE_DIR}/src/$${input_file}.ui -o $${CMAKE_CURRENT_SOURCE_DIR}/src/ui_$${input_file}.py
COMMAND pyside6-uic $${CMAKE_CURRENT_SOURCE_DIR}/src/$${input_file}.ui -o $${CMAKE_CURRENT_SOURCE_DIR}/src/ui_$${input_file}.py
DEPENDS $${CMAKE_CURRENT_SOURCE_DIR}/src/$${input_file}.ui
COMMENT "Generating src/ui_$${input_file}.py from src/$${input_file}.ui"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
cmake_minimum_required(VERSION 2.6)
PROJECT( ${component_name} )

INCLUDE( /home/robocomp/robocomp/cmake/robocomp.cmake )
IF ( "$$ENV{ROBOCOMP}" STREQUAL "")
MESSAGE(WARNING "ROBOCOMP variable not set. Using the default value: /home/robocomp/robocomp")
SET (ENV{ROBOCOMP} "/home/robocomp/robocomp/")
ENDIF ( "$$ENV{ROBOCOMP}" STREQUAL "")

IF(NOT EXISTS $$ENV{ROBOCOMP}/cmake)
MESSAGE(FATAL_ERROR "Couldn't find RoboComp in $$ENV{ROBOCOMP}! Exiting...")
ENDIF(NOT EXISTS $$ENV{ROBOCOMP}/cmake)

INCLUDE( $$ENV{ROBOCOMP}/cmake/robocomp.cmake )

ROBOCOMP_IDSL_TO_ICE( CommonBehavior ${ifaces_list} )
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ def sigint_handler(*args):

interface_manager.set_default_hanlder(worker)
signal.signal(signal.SIGINT, sigint_handler)
app.exec_()
app.exec()
interface_manager.destroy()
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, component):
def import_qtwidgets(self):
result = ""
if self.component.gui is not None:
result += 'from PySide2 import QtWidgets\n'
result += 'from PySide6 import QtWidgets\n'
return result

def app_creation(self):
Expand Down

0 comments on commit 71a9ee5

Please sign in to comment.