Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Firstly you are using PySide(Nokia) not PyQt4(Riverbank Computing), although their API's are nearly identical they are not the same project. The PySide examples are available here: git clone git://gitorious.org/pyside/pyside-examples.git</p> <p>I think the problem may have to do with your call of </p> <pre><code>super(MyMainWindow, self).__init__(parent) </code></pre> <p>try</p> <pre><code>QtGui.QMainWindow.__init__(self, parent) </code></pre> <p>instead.</p> <p>I know it seems like it is the same thing, but I've ran into similar problems with super using PyQt4, and from what I can tell Nokia's PySide has the same troubles. It has something to do with weather the Python owns the parent or it's owned by an underlying C++ object. At least give it a try, it'll take less than 5 seconds!</p> <p>Below is the example I'm basing this off of, it's from the git repo for PySide.</p> <pre><code>#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2004-2005 Trolltech AS. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the Free Software Foundation ## and appearing in the file LICENSE.GPL included in the packaging of ## this file. Please review the following information to ensure GNU ## General Public Licensing requirements will be met: ## http://www.trolltech.com/products/qt/opensource.html ## ## If you are unsure which license is appropriate for your use, please ## review the following information: ## http://www.trolltech.com/products/qt/licensing.html or contact the ## sales department at sales@trolltech.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# import sys from PySide import QtCore, QtGui from ui_calculatorform import Ui_CalculatorForm class CalculatorForm(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_CalculatorForm() self.ui.setupUi(self) @QtCore.pyqtSignature("int") def on_inputSpinBox1_valueChanged(self, value): self.ui.outputWidget.setText(QtCore.QString.number(value + self.ui.inputSpinBox2.value())) @QtCore.pyqtSignature("int") def on_inputSpinBox2_valueChanged(self, value): self.ui.outputWidget.setText(QtCore.QString.number(value + self.ui.inputSpinBox1.value())) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) calculator = CalculatorForm() calculator.show() sys.exit(app.exec_()) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload