You are not logged in.

#1 2007-11-11 12:28:19

ornitorrincos
Forum Fellow
From: Bilbao, spain
Registered: 2006-11-20
Posts: 198

pyqt4 error

I'm trying to create a python program with qt4, but when I try to run just the gui i get this error:

Traceback (most recent call last):
  File "./jardin.py", line 2, in <module>
    from ventana import *
  File "/home/ilcra1989/uni/svn/perns/trunk/qt/jardin/ventana.py", line 10, in <module>
    from PyQt4 import QtCore, QtGui
RuntimeError: the PyQt4.QtCore and qt modules both wrap the QObject class

and the code in the main program is this

from qt import *
from ventana import *
import sys
if __name__ == "__main__":
  app = QApplication(sys.argv)
  f = Form1()
  f.show()
  app.setMainWidget(f)
  app.exec_loop()

any ideas?

ok, I have done it with this

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import uic
import sys
if __name__ == "__main__":
    app = QApplication(sys.argv)
    f = uic.loadUi('./ventana.ui')
    f.show()
    app.exec_()

it seems that from qt import * refers to qt3, so it complained that i had part of the program using pyqt3 and the other one pyqt4

Last edited by ornitorrincos (2007-11-11 14:00:31)


-$: file /dev/zero
/dev/zero: symbolic link to '/dev/brain'

Offline

Board footer

Powered by FluxBB