Hi all.
I am having trouble getting my QWizard to work.
I have the following QAction:
newAction
= new QAction(QIcon(":/images/png/16x16/note_add.png"), tr
("&New"),
this);
newAction->setStatusTip(tr("Create new profile"));
connect(newAction, SIGNAL(triggered()), this, SLOT(newSlot()));
newAction = new QAction(QIcon(":/images/png/16x16/note_add.png"), tr("&New"), this);
newAction->setShortcut(QKeySequence::New);
newAction->setStatusTip(tr("Create new profile"));
connect(newAction, SIGNAL(triggered()), this, SLOT(newSlot()));
To copy to clipboard, switch view to plain text mode
and the newSlot, slot:
void MainWindow::newSlot()
{
NewWizard wizard;
wizard.show();
}
void MainWindow::newSlot()
{
NewWizard wizard;
wizard.show();
}
To copy to clipboard, switch view to plain text mode
And my NewWizard class:
NewWizard
::NewWizard(QWidget *parent
) : QWizard
(parent
){
addPage(new IntroPage);
addPage(new InformationPage);
setPixmap
(QWizard
::BannerPixmap,
QPixmap(":/images/png/tux.png"));
setPixmap
(QWizard
::BackgroundPixmap,
QPixmap(":/images/png/tux.png"));
setWindowTitle(tr("New profile"));
}
IntroPage
::IntroPage(QWidget *parent
) : QWizardPage
(parent
){
setTitle(tr("Introduction"));
setPixmap
(QWizard
::WatermarkPixmap,
QPixmap(":/images/png/tux.png"));
QLabel *label
= new QLabel(tr
("bla bla bla bla bla bla bla"));
label->setWordWrap(true);
layout->addWidget(label);
setLayout(layout);
}
InformationPage
::InformationPage(QWidget *parent
) : QWizardPage
(parent
){
setTitle(tr("Information"));
QLabel *label
= new QLabel(tr
("bla bla bla bla bla bla bla"));
label->setWordWrap(true);
layout->addWidget(label);
setLayout(layout);
}
NewWizard::NewWizard(QWidget *parent) : QWizard(parent)
{
addPage(new IntroPage);
addPage(new InformationPage);
setPixmap(QWizard::BannerPixmap, QPixmap(":/images/png/tux.png"));
setPixmap(QWizard::BackgroundPixmap, QPixmap(":/images/png/tux.png"));
setWindowTitle(tr("New profile"));
}
IntroPage::IntroPage(QWidget *parent) : QWizardPage(parent)
{
setTitle(tr("Introduction"));
setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/png/tux.png"));
QLabel *label = new QLabel(tr("bla bla bla bla bla bla bla"));
label->setWordWrap(true);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(label);
setLayout(layout);
}
InformationPage::InformationPage(QWidget *parent) : QWizardPage(parent)
{
setTitle(tr("Information"));
QLabel *label = new QLabel(tr("bla bla bla bla bla bla bla"));
label->setWordWrap(true);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(label);
setLayout(layout);
}
To copy to clipboard, switch view to plain text mode
But when I go to the menu and choose the new action, the wizard is not displayed. What am I doing wrong?
Bookmarks