View Single Post
helex's Avatar
Posts: 543 | Thanked: 802 times | Joined on Apr 2010 @ Germany
#6
Originally Posted by mikec View Post
You should not have to re-implement those events just for a close.

here some code that works, generated from qt designer.
it opens a main window, with a big button that shows the dialog.
dialog has two buttons that accept and reject then closes the dialog.
Oh jeah, thanks a lot!

Your example worked just simple and easy. On my N900 and on my PC. I compared it with my code step by step and now I spent over 1 hour trying and fiddle out because of what part of the code my example and also my main project was not working.

And now it was the LAST thing I had suspected.

I used this in my Main program:

Code:
def reject(self):
    self.close()
and the code was called because of this, created by QtDesigner:

Code:
QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL("clicked()"), Dialog.reject)
I don't understand why it won't close after calling the sub function. The function itself was called correctly.

But now using your function from your code and from your fist example it works perfect:
Code:
def on_backButton_clicked(self):
Actually for me still a total mystery. But okay, I'm learning qt and python since 2 Weeks in my rare spare time. So I've many to learn...

And I have to apologise myself... I'm not a big contributor at maemo talk. I'm a interested reader since November. But I hope while learning Python, Qt and how to deploy the one or other nice application to Maemo Extras I can help the comunity more than simply speculating about the next firmware relase.