PyQCustomPlot::Plugin Class Reference

Provide bindings of QCustomPlot library in PythonQt terminal. More...

#include </root/robotpkg/graphics/gepetto-viewer-corba/work.runner-e7e27102-project-90-concurrent-0/gepetto-viewer-corba-5.1.1/plugins/pyqcustomplot/plugin.hh>

Inheritance diagram for PyQCustomPlot::Plugin:
[legend]
Collaboration diagram for PyQCustomPlot::Plugin:
[legend]

Public Member Functions

QString name () const
 
void init ()
 Calls registerQCustomPlot. More...
 
- Public Member Functions inherited from gepetto::gui::PluginInterface
 PluginInterface ()
 
virtual ~PluginInterface ()
 
void doInit ()
 
bool isInit () const
 
const QString & errorMsg () const
 

Additional Inherited Members

Detailed Description

Provide bindings of QCustomPlot library in PythonQt terminal.

See QCustomPlotDecorator for the API available in Python.

Add the following to your settings file to activate it.

[plugins]
libpyqcustomplot.so=true
Example: Simple usage of QCustomPlot Python bindings.
1 from PythonQt import QtGui
2 from PythonQt.QCustomPlot import QCustomPlot, QCPItemTracer, QCPItemRichText, QCP
3 
4 class Plugin (QtGui.QDockWidget):
5  def __init__ (self, mainWindow, flags = None):
6  if flags is None:
7  super(Plugin, self).__init__ ("QCP example plugin", mainWindow)
8  else:
9  super(Plugin, self).__init__ ("QCP example plugin", mainWindow, flags)
10  self.setObjectName("QCP example plugin")
11 
12  self.main = mainWindow
13  self.qcp = QCustomPlot ()
14  self.qcp.setInteraction (QCP.iRangeDrag, True)
15  self.qcp.setInteraction (QCP.iRangeZoom, True)
16  self.setWidget (self.qcp)
17 
18  self.graph = self.qcp.addGraph ()
19  self.graph.setData ([0,1,2,3], [0.1,0.3,0.2,0])
20  self.qcp.replot()
21 
22  self.tracer = QCPItemTracer (self.qcp)
23  self.tracer.graph = self.graph
24  self.tracer.graphKey = 0
25  self.tracer.style = 3
26 
27  self.text = QCPItemRichText (self.qcp)
28  self.text.text = u"q<sub>0,0</sub>"
29  self.text.position("position").setParentAnchor(self.tracer.anchor("position"))
30  self.text.position("position").setCoords (0, -20)
31 
32  self.graph.setData ([0,1,2,3], [1,0.3,0.2,0])
See also
See examples pyplugin/qcustomplot_example_2.py

Member Function Documentation

void PyQCustomPlot::Plugin::init ( )
virtual

Calls registerQCustomPlot.

Implements gepetto::gui::PluginInterface.

Referenced by name().

QString PyQCustomPlot::Plugin::name ( ) const
inlinevirtual

Implements gepetto::gui::PluginInterface.

References init().