0

hy,

soooo, i created the MainWindow.ui file with the QTDesigner. Then i import this gui with following command into my .py file:

form_class = uic.loadUiType("ess_project.ui")[0]  

What is the difference if i compile this .ui file with pyuic4 ? (every time i compiled my .ui file i got following error:

RuntimeError: the sip module implements API v11.0 to v11.1 but the PyQt4.QtCore module requires API v10.1

The MainWindow create the first window, where all buttons etc. are placed.

class MainWindow(QtGui.QMainWindow, form_class):
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        PlotWindow.__init__(self)
        self.setupUi(self)
        self.pb_send.clicked.connect(self.pb_send_clicked)
        self.pb_open.clicked.connect(self.pb_open_clicked)
        self.pb_exit.clicked.connect(self.pb_exit_clicked)
        self.comboBox.currentIndexChanged.connect(self.combo_box_changed)

furthermore i have a second class named "PlotWindow". This class looks like this:

class PlotWindow(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.w = QtGui.QMainWindow()
        self.cw = pg.GraphicsLayoutWidget()
        self.w.show()
        self.w.resize(900,600)
        self.w.setCentralWidget(self.cw)
        self.w.setWindowTitle('pyqtgraph: G-CODE')
        self.p = self.cw.addPlot(row=0, col=0)

now as you can see, the PloWindow - class create a second Window.

How can i implement the pg.GraphicsLayoutWidget() into the MainWindow - class ??

not sure if this can help you ?!? :

def main():
    app = QtGui.QApplication([])
    myWindow = MainWindow(None)
    myWindow.show()
    app.exec_()

if __name__ == '__main__':
    main()

I am using python3 !!! feel FREE to comment :) thanks !

3
  • The RuntimeError above looks like a problem with your pyqt installation. Commented Jun 28, 2014 at 19:57
  • Ok yes this make sense ^^ What is if i install a new sip version? Will the old sip version deleted? or how can i tell my programm to use a other sip version ? Commented Jun 28, 2014 at 20:04
  • This all depends on your OS and method of installation. I would recommend just uninstalling sip+pyqt and try reinstalling by different methods until you find something that works. Commented Jun 28, 2014 at 20:39

1 Answer 1

1

To place any pyqtgraph widgets inside your application, you add a placeholder widget and "promote" it to the pg class that you want. See: http://www.pyqtgraph.org/documentation/how_to_use.html#embedding-widgets-inside-pyqt-applications

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.