Results 1 to 4 of 4

Thread: Use python widget created with PyQt4 in Qt applications

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Use python widget created with PyQt4 in Qt applications

    Hi all,
    I want to use MatPlotLib into Qt applications. I know that i have to use PyQt4, and also i know how to use QtDesigner with python.
    But i don't know how to use widget created with python in qt applications???

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use python widget created with PyQt4 in Qt applications

    Do I understand right that you wish to put some python code into your C++ application?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Use python widget created with PyQt4 in Qt applications

    I create a widget (with a plot into it) by python. Then i want to use this widget in my Qt application and put this widget inside my mainWindow which created in qt(not python) by hardcoding.
    If i need to put python code in qt for that then that's true wysota. do you have suggestions for me?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use python widget created with PyQt4 in Qt applications

    I guess you need to embed a python interpreter in your program, import PyQt and MathPlotLib into the environment, do something to make the environment see your QApplication object and possibly other needed objects (such as windows) and then run some python code needed to get you going with the charts.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    alizadeh91 (28th November 2012)

Similar Threads

  1. Embedding PyQt4 into an Application running Python via Boost::Python
    By GreyHound in forum Installation and Deployment
    Replies: 1
    Last Post: 6th February 2012, 06:48
  2. PyQt4 app : high CPU usage from python and Xorg
    By tipote in forum Qt Programming
    Replies: 3
    Last Post: 30th January 2012, 17:50
  3. Replies: 1
    Last Post: 15th September 2010, 22:15
  4. PyQt4: Create simple GUI for python program
    By Norchina in forum Newbie
    Replies: 0
    Last Post: 11th June 2010, 14:50
  5. Replies: 1
    Last Post: 15th February 2010, 23:20

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.