I've read that thing about the signals/slots and that was exactly what I was trying to do (at least I thought that was exactly what they said). Here's an example from a Qt Address Book tutorial: connect(nextButton, SIGNAL(clicked()), this, SLOT(next())); As the QMessageBox needs a parent reference, 'this' is fine for the MainWindow. This is my slot: QObject.Connect(btnAbout, Qt.SIGNAL("clicked()"), mainwin, Qt.SLOT("ShowAbout(mainwin, page)")); First, the Qt one doesn't have these " ", so I thought it might be a Qyoto thing. 'this' is a reference to MainWindow. In my StartWindow, 'mainwin' is a reference to the MainWindow. If I use a slot in MainWindow I pass the slot a 'this' reference as in the example. If I use a slot in the StartWindow I pass it a reference to MainWindow as 'mainwin'. Are you saying if I declare the SecondWindow class as inherited from :QWidget I should then pass the reference to itself as 'this' rather than a reference to the MainWindow? In the StartWindow the QMessageBox also needs a parent reference, that's why I pass 'mainwin' - reference to parent MainWindow. What do you mean by passing a type rather than a variable? How do you pass a type if you need to pass a reference to the parent window? If I pass anything else it complains that that reference doesn't exist in the current context.
|