[PyQt] Make a exec_() in a Dialog

rudsonalves at yahoo.com.br rudsonalves at yahoo.com.br
Sat Nov 15 17:24:08 GMT 2008


Hi,

I am implementing a dialogue to download programs in an application.  I
need to start the dialog to download a file, only after the call of
.exec_().

I try implement a .exec_() method, but it no open dialog window. See code:

...
class DownloadDlg(QDialog, Ui_DownloadDialog):
    url = ''
    destiny = ''
    proxy = None
    backup = False

    def __init__(self, url, destiny, proxy = None, parent = None):
        super(DownloadDlg, self).__init__(parent)
        self.setupUi(self)

        self.urlLabel.setText(url)
        self.downloadProgressBar.setValue(0)
        self.url = url
        self.destiny = destiny
        self.proxy = proxy

    def exec_(self):
        print 'Go, go, go ...'
        self.show()
        if self.urlLabel.text() != '':
            print 'Start...'
            self.wget_file() # Download routine
        else:
            QMessageBox.Warning(self, 'Invalid url')
            QDialog.accept(self)
...

Is there any signal emitted by .exec_() or some other way to do this?

Thanks,
Alves
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger 
http://br.beta.messenger.yahoo.com/ 


More information about the PyQt mailing list