PySide Pyqtgraph and Signals

353 views
Skip to first unread message

ahammernes

unread,
Dec 16, 2015, 9:07:54 AM12/16/15
to pyqtgraph
I have a gui witch is created with qt creator and pyside. Now to show the plots i want i am using something like: 

class MyGraphWindow(pg.GraphicsLayoutWidget):
    windowClicked = QtCore.Signal(int, int)
    activeGrapchanged = QtCore.Signal(int)
    closeRequest = QtCore.Signal(int)
    newplot = QtCore.Signal(int)

    def __init__(self, winNr):
        super(MyGraphWindow, self).__init__()
        self.graphs = {}
        self.winNr = winNr

And then i have a function wich will add a plot into the window using addItem. 
this is the code for the plotitem: 
class PltItem(pg.PlotItem):
    pltClicked = QtCore.Signal(int)

    def __init__(self, graphnr, parent=None):
        super(PltItem, self).__init__(parent, axisItems={'bottom': TimeAxis()})
        self.graphnr = graphnr
        self.stackedNumber = 0
        self.selecteddata = []
        self.showGrid(True, True)
        self.plotters = []
        colors = ('y', 'g', 'r', 'b', 'w', 'm', 't')
Now the Signal() is not working, i get the error message : 
AttributeError: 'PySide.QtCore.Signal' object has no attribute 'connect'
This error was never present before i installed pyside and pyqtgraph again. I notice that my Signal method approche is the same many of the classes for pyqtgraph. 
So the question is, what gives ??? 

-Aleks




ahammernes

unread,
Dec 16, 2015, 10:00:06 AM12/16/15
to pyqtgraph
Apperantly this is a import issue.... 
If i import pyqtgraph as pg before anything else my gui and and plot windows appear as they should.
how ever the signals and slot do not work as they should. 
If i import pyside before pyqtgraph the signals and slots work as they should, but the plotitems do not show their 
grids and plots at all, yet the legends inserted show as they should....   
PySide version 1.2.4 
pyqtgraph version 0.9.10 
it do not look like i have pyqt installed, when i do pip list i can not see it, and it is not in Lib/site-packages. 
-Aleks

vas...@gmail.com

unread,
Dec 16, 2015, 10:02:22 PM12/16/15
to pyqt...@googlegroups.com
pyqt 4 packages that works for me for pyqtgraph demoscripts are:
python-qt4
python-qt4-gl

--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/d1560187-beb9-4abd-8402-ee7f0a447408%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Luke Campagnola

unread,
Dec 21, 2015, 2:12:11 AM12/21/15
to pyqt...@googlegroups.com
On Wed, Dec 16, 2015 at 7:00 AM, ahammernes <ahamm...@gmail.com> wrote:
Apperantly this is a import issue.... 
If i import pyqtgraph as pg before anything else my gui and and plot windows appear as they should.
how ever the signals and slot do not work as they should. 

It sounds like pyqtgraph is using a different version of Qt than the one you are importing. You can use `pg.systemInfo()` to see which version it is using, and generally you can change that by importing PySide before pyqtgraph.

 
If i import pyside before pyqtgraph the signals and slots work as they should, but the plotitems do not show their 
grids and plots at all, yet the legends inserted show as they should....   
PySide version 1.2.4 
pyqtgraph version 0.9.10 
it do not look like i have pyqt installed, when i do pip list i can not see it, and it is not in Lib/site-packages. 

Sounds more strange.. We might need to see a code example (preferrably a simple, runnable script that demonstrates the issue).
Reply all
Reply to author
Forward
0 new messages