PDA

View Full Version : Run an active window inside an PyQT5 GUI application



Ircbarros
19th July 2019, 15:15
Hello! I'm using PyQT5, and I want to run an external window inside a TabWidget, something similar to that (https://stackoverflow.com/questions/57085854/run-an-active-window-inside-an-pyqt5-gui-application?noredirect=1&lq=1), but this example is for Windows only, and I want to run in a Linux (Ubuntu 14.04) os. This question (https://stackoverflow.com/questions/51864808/how-to-use-pyqt-method-qwindow-fromwinidid-on-linux?noredirect=1&lq=1) is very similar to mine, but I didn't find the solution. Also, find a similar problem (the exact thing I want to do) in this thread (https://stackoverflow.com/questions/53883386/how-can-i-embed-another-software-in-my-qt-window-in-linux/57084914#57084914) but the answers didn't work. Also tried the solution here (https://stackoverflow.com/questions/57015932/how-to-attach-and-detach-an-external-app-with-pyqt5-or-dock-an-external-applicat) but didn't work either. I know that is possible to embed a terminal, like this code (https://stackoverflow.com/questions/51975678/embedding-a-terminal-in-pyqt5), but i have no idea how to do the same with the "RViz" shell command.

I already tried to open the rviz win alone, acquiring his ID with the wmctrl command (wmctrl -l | grep -i RViz | awk '{print $1}') via shell and used his ID parsed to winID (i copy and pasted the value) class from PyQT, doesn't work either. I think that maybe is my code because some people do that in windows using the win32gui module. My code can be found here (https://stackoverflow.com/questions/57085854/run-an-active-window-inside-an-pyqt5-gui-application), someone can help me with that, please?

d_stranz
19th July 2019, 16:25
Don't double post. You asked the question once in the Newbie section. All of us read every new post no matter where it appears.