Form1.show()

E

errmaker

hi ! iam newbie on python.
how i can make form1 visible ? form just crated by pyqt



class Form1(QMainWindow):
def __init__(self,parent = None,name = None,fl = 0):
QMainWindow.__init__(self,parent,name,fl)
self.statusBar()

............

if self.MenuBar.findItem(1):
self.MenuBar.findItem(1).setText(self.__tr("&File"))
if self.MenuBar.findItem(2):
self.MenuBar.findItem(2).setText(self.__tr("&Edit"))
if self.MenuBar.findItem(3):
self.MenuBar.findItem(3).setText(self.__tr("&Help"))


def fileNew(self):
print "Form1.fileNew(): Not implemented yet"

......


def __tr(self,s,c = None):
return qApp.translate("Form1",s,c)
 
D

Diez B. Roggisch

errmaker said:
hi ! iam newbie on python.
how i can make form1 visible ? form just crated by pyqt



class Form1(QMainWindow):
def __init__(self,parent = None,name = None,fl = 0):
QMainWindow.__init__(self,parent,name,fl)
self.statusBar()

............

if self.MenuBar.findItem(1):
self.MenuBar.findItem(1).setText(self.__tr("&File"))
if self.MenuBar.findItem(2):
self.MenuBar.findItem(2).setText(self.__tr("&Edit"))
if self.MenuBar.findItem(3):
self.MenuBar.findItem(3).setText(self.__tr("&Help"))


def fileNew(self):
print "Form1.fileNew(): Not implemented yet"

......


def __tr(self,s,c = None):
return qApp.translate("Form1",s,c)

Look at teh examples of PyQt - you need to have an application instanced
and calle its event-loop.


Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top