Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How i embed an external window inside an PyQt5 Application?
Forum Updated to NodeBB v4.3 + New Features

How i embed an external window inside an PyQt5 Application?

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 2.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ircbarros
    wrote on last edited by
    #1

    I'm using PyQT5, and I want to run an external window application inside an TabWidget, something similar to that, but this example is for windows only, and i want to run in a linux (Ubuntu 14.04) os. I also find a similar problem in this thread but the answers didn't work. Is possible to embed an terminal, like this code, but i have no idea how to do the same with the "rviz" shell command. I have some code here, who uses wmctrl to pick the RViz (the application that i want to embed in my GUI) window ID, and try to put inside the "fromWinID()" class, but the window opens outside my app and also receive the error:

    QXcbConnection: XCB error: 3 (BadWindow), sequence: 415, resource id: -1222189812, major code: 7 (ReparentWindow), minor code: 0
    QXcbConnection: XCB error: 3 (BadWindow), sequence: 460, resource id: -1222189812, major code: 7 (ReparentWindow), minor code: 0
    QXcbConnection: XCB error: 3 (BadWindow), sequence: 461, resource id: -1222189812, major code: 8 (MapWindow), minor code: 0
    QXcbConnection: XCB error: 3 (BadWindow), sequence: 463, resource id: -1222189812, major code: 18 (ChangeProperty), minor code: 0
    QXcbConnection: XCB error: 3 (BadWindow), sequence: 464, resource id: -1222189812, major code: 12 (ConfigureWindow), minor code: 0

    Someone can help please?

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      Depending on the terminal program, under X11, it (MAY) have an option such as -wid {win} to supply to it, the X11 window ID of a window where it is to render its information.

      In Qt you can inquire the X11 window ID of any visible widget using the API. Provide that ID to your shell program.

      I use this scheme to embed an mplayer video window in a Qt App.

      The other approach is to use the popen() API to capture a shell session and create your own native Qt window, rendering the text therein.

      I light my way forward with the fires of all the bridges I've burned behind me.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved