Hi, I have my own widgets ( simple one) and want to put them in one file and call them from second file. This is like easygui but with pyqt4.
My problem - when I call my widget from second file nothing happens.
This is file with widgets (example).
import sys
from PyQt4 import QtGui, QtCore
class QuitButtonAA(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Icon AA')
quit = QtGui.QPushButton('Close', self)
quit.setGeometry(10, 10, 60, 35)
self.connect(quit, QtCore.SIGNAL('clicked()'),
QtGui.qApp, QtCore.SLOT('quit()'))
class QuitButtonBB(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Icon BB')
quit = QtGui.QPushButton('Close', self)
quit.setGeometry(10, 10, 60, 35)
self.connect(quit, QtCore.SIGNAL('clicked()'),
QtGui.qApp, QtCore.SLOT('quit()'))
And this is second file.
import mywidgets as g
# do this
g.QuitButtonBB
# then do this
g.QuitButtonAA
Could anyone help me?
TIA