Results 1 to 4 of 4

Thread: embed Python in Qt C++ program and use signals/slots

  1. #1
    Join Date
    Jun 2012
    Posts
    63
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default embed Python in Qt C++ program and use signals/slots

    I want to embed Python in my Qt c++ project so that I can run Python scripts within the main Qt C++ program.

    I have several c++ QObject-derived classes that emit signals. I would like have these c++ objects exposed in Python-side so that I can create Python classes with slots connected to signals that are emitted from c++.

    Is this possible ? I don't necessary need a full solution but some pointers on where to start. Thanks!

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,055
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: embed Python in Qt C++ program and use signals/slots

    Ever tried that "Google" thing? Click here!
    Last edited by d_stranz; 26th August 2016 at 00:53.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jun 2012
    Posts
    63
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: embed Python in Qt C++ program and use signals/slots

    Thanks!

    I read that.. very good info!

    But something was missing. I couldn't find any info about how to 'glue' a signal emitted from "c++" side into an object living in Python script runtime.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,055
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: embed Python in Qt C++ program and use signals/slots

    You should really try that Google thing. This is for PyQt4; PyQt5 supports the new style of signal / slot connections as well as the old style.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 19
    Last Post: 9th March 2015, 19:33
  2. Replies: 2
    Last Post: 18th April 2013, 12:15
  3. PyQt4: Create simple GUI for python program
    By Norchina in forum Newbie
    Replies: 0
    Last Post: 11th June 2010, 14:50
  4. Replies: 1
    Last Post: 15th February 2010, 23:20
  5. how to embed an existing kde program into Konquerer
    By sephiroth_0 in forum KDE Forum
    Replies: 1
    Last Post: 15th August 2006, 12:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.