#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
def __init__(self,parent=None): # Parentesco
super(popup,self).__init__(parent)
self.setWindowTitle("Janela Popup")
self.setMinimumSize(400 , 400)
def __init__(self, parent=None):
super(Mainw, self).__init__(parent)
self.setMinimumSize(400 , 400)
self.setWindowTitle("Janela Principal")
self.
btn1.
setGeometry(QRect(100,
50,
200,
200))
QObject.
connect(self.
btn1,
SIGNAL("clicked()"), self.
openpopup)
def openpopup(self):
pop = popup(self)
pop.show()
if __name__ == "__main__":
main = Mainw()
main.show()
sys.exit(app.exec_())
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
class popup(QMainWindow):
def __init__(self,parent=None): # Parentesco
super(popup,self).__init__(parent)
self.setWindowTitle("Janela Popup")
self.setMinimumSize(400 , 400)
class Mainw(QMainWindow):
def __init__(self, parent=None):
super(Mainw, self).__init__(parent)
self.setMinimumSize(400 , 400)
self.setWindowTitle("Janela Principal")
self.btn1 = QPushButton("Popup", self)
self.btn1.setGeometry(QRect(100, 50, 200, 200))
QObject.connect(self.btn1, SIGNAL("clicked()"), self.openpopup)
def openpopup(self):
pop = popup(self)
pop.show()
if __name__ == "__main__":
app = QApplication(sys.argv)
main = Mainw()
main.show()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
Bookmarks