2

I have a QWizard and I need to perform certain actions each time a wizard page becomes visible. Currently I am doing this in the validateCurrentPage function but I have realised that it is only called when the Next button is pressed, not the Back button.

I've tried the currentIdChanged and customButtonClicked signals but these don't get called either.

Any idea how I can respond to a wizard page that is shown after the Back button is pressed? I must be missing something simple...

Thanks, Alan

Edit: Added code and compiler error as requested by cmannett85

QAbstractButton *backButton = button(QWizard::BackButton);
connect(backButton, SIGNAL(clicked()), this, SLOT(backClicked));

The full error is:

Error 1 error C2664: 'bool QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' : cannot convert parameter 1 from 'QAbstractButton *' to 'const QObject *'

4

1 回答 1

2

获取后退按钮QAbstractButton *QWizard::button (WizardButton which)并将其连接到插槽。

例子:

QAbstractButton *backButton = wizard->button(QWizard::BackButton);
connect(backButton, SIGNAL(clicked()), this, SLOT(backClicked()));
于 2013-05-15T13:15:38.097 回答