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.
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_()
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__':
app = QtGui.QApplication(sys.argv)
libertas = Libertas()
libertas.main()
app.exec_()
To copy to clipboard, switch view to plain text mode
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
AttributeError: 'Ui_Dialog' object has no attribute 'show'
Segmentation fault
AttributeError: 'Ui_Dialog' object has no attribute 'show'
Segmentation fault
To copy to clipboard, switch view to plain text mode
I dont see whats wrong.
Bookmarks