Creating popup windows pyqt4
I'm trying to create a pop up window to run in the beginning of my program. I am wondering how to make my popup window show once I run my program and how to create a signal slot connection from that popup window to my main window using pyqt4 and qt4 designer?
To start off: I have created a new dialog called popup with two buttons, ok and cancel using qt4 designer. This is the window I would like to make a signal slot connection between the main window and the dialog. Thank you in advance.
Re: Creating popup windows pyqt4
Im trying to do the same thing. I have my main window class and in one of the methods I want to call a dailogUi popup window. I have no clue how.
Code:
from PyQt4 import QtGui, QtCore
import sys
import tweepy
import os
from my_functions import *
import libertasUi
import fileUi
import connectionUi
import pinUi
import webbrowser
class Libertas
(QtGui.
QWidget, libertasUi.
Ui_Form): def __init__(self, parent=None):
super(Libertas, self).__init__(parent)
self.setupUi(self)
def pop_ups(self, code):
if code == 15:
file_dailog =fileUi.Ui_Dialog()
file_dailog.show
elif code == 10:
pass
else:
pass
def main(self):
self.show()
self.get_lists()
if __name__ == '__main__':
libertas = Libertas()
libertas.main()
app.exec_()
I made the dialog with qt designer and compiled it to fileUi.py. It is basically an oops! dialog "Cant find file"
I get the error
Code:
AttributeError: 'Ui_Dialog' object has no attribute 'show'
Segmentation fault
I dont see whats wrong.