After getting my PythonQt to work ,thanks to Sergey, I am having troubles adding QCustomPlot to pythonQt.
I would like to use the QCustomPlot functions inside my script.
Currently I use:
QCustomPlot *graph = new QCustomPlot;
mainContext.addObject("graph",graph);
Which works a bit, I can use functions like graph.newgraph();. However, functions like graph.xAxis.setLabel("test"); don't exist, 'xAxis' is unknown. I tried to do it like the example 'PyCPPWrapperExample' but I am unable of creating a wrapper for QCustomPlot.
Help is much appreciated :)
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please not that I did NOT wrap all of the functions of QCustomPlot. I think you can easily add them yourself if you need some other function I did not wrap.
Also, I'm pretty sure that here are other, better ways to do the above but this was the only thing I could manage.The thing that I am primarily missing is the capability to do things like this:
graph.level1.level2 I can't get past level1 so all my wrapped functions that are deeper than level1 have a different but similar name with underscores.
Last edit: Poep Hoofd 2015-10-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
After getting my PythonQt to work ,thanks to Sergey, I am having troubles adding QCustomPlot to pythonQt.
I would like to use the QCustomPlot functions inside my script.
Currently I use:
Which works a bit, I can use functions like
graph.newgraph();
. However, functions likegraph.xAxis.setLabel("test");
don't exist, 'xAxis' is unknown. I tried to do it like the example 'PyCPPWrapperExample' but I am unable of creating a wrapper for QCustomPlot.Help is much appreciated :)
Thanks!
To answer my own question:
Add this to QCustomPlot.h:
and use this in your main:
Then, in your script/console :
Please not that I did NOT wrap all of the functions of QCustomPlot. I think you can easily add them yourself if you need some other function I did not wrap.
Also, I'm pretty sure that here are other, better ways to do the above but this was the only thing I could manage.The thing that I am primarily missing is the capability to do things like this:
graph.level1.level2
I can't get past level1 so all my wrapped functions that are deeper than level1 have a different but similar name with underscores.Last edit: Poep Hoofd 2015-10-16