PDA

View Full Version : connecting two wizards



arjita
14th November 2012, 18:58
I have created two wizards , i want that when i clicked finish of one wizard another wizard gets opened.. Is there any way of connecting finish button of first wizard to 2nd wizard?? please help

amleto
14th November 2012, 19:37
signal/slot mechanism - pretty handy! ;)

finished slot on one wizard -> exec() / open() / show() slot on the next

arjita
16th November 2012, 10:27
as you said me to use signal and slots, it is giving me error..
no matching function for call to 'dynamic::connect(QWizard::WizardButton, const char [11], edges*, const char [11])'
code..
I am trying to connect finish button of dynamic to edge wizard..


//dynamic.h
class dynamic : public QWizard
{
Q_OBJECT

public:
explicit dynamic(QWidget *parent = 0);
~dynamic(){}

};
//dynamic.cpp
#include "dynamic.h"
#include "edges.h"
#include <QtGui>
dynamic::dynamic(QWidget *parent)
: QWizard(parent)
{

edges e;
connect(FinishButton,SIGNAL(clicked()),&e,SLOT(e.show()));
}
//edges.h
class edges : public QWizard
{
Q_OBJECT

public:
explicit edges(QWidget *parent = 0);
~edges(){}
public slots:
void app_run();

};
//edges.cpp
#include "edges.h"
class QLineEdit;
edges::edges(QWidget *parent)
: QWizard(parent)
{

setOption(QWizard::NoBackButtonOnLastPage,true);
setWindowTitle(tr("Edge Wizard"));

}
void edges::app_run()
{
this->show();
}

wysota
16th November 2012, 10:35
The first argument of connect() has to be an object instance, not an enum.

amleto
16th November 2012, 11:02
object instance pointer ;)