[PyQt] Embed PyQt view in Qt window

Phil Thompson phil at riverbankcomputing.com
Wed Mar 21 09:13:49 GMT 2018


On 20 Mar 2018, at 10:52 pm, Keith Lostracco <keith at intentdev.io> wrote:
> 
> I am in the process of designing an application that will be built in C++. 
> 
> The app will have an embedded python interpreter for rapid development of algorithms. 
> 
> The application GUI will be built with Qt.
> 
> I'm thinking of coming up with a rapid workflow where a developer could use QtCreator to design a small UI with some input fields, sliders, button etc.. then run a function that calls uic and make a Python class. The user loads the path to the file (or it that is automated as well) and the GUI module is expose their Python script they are creating. 
> 
> As far as I can tell this should all work fine but at when the PyQt is executed, from our Python program in our embedded Python interpretor in our C++ application, it will load a floating window.
> 
> Is there way to load PyQt within a Qt window in our Python embedded application? 
> 
> That way the widgets would appear to be part of our main application.

Have you read...

http://pyqt.sourceforge.net/Docs/sip4/embedding.html#using-the-c-api-when-embedding

Phil


More information about the PyQt mailing list