Ossi
1st September 2009, 14:37
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->setShortcut(QKeySequence::New);
newAction->setStatusTip(tr("Create new profile"));
connect(newAction, SIGNAL(triggered()), this, SLOT(newSlot()));
and the newSlot, slot:
void MainWindow::newSlot()
{
NewWizard wizard;
wizard.show();
}
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);
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);
}
But when I go to the menu and choose the new action, the wizard is not displayed. What am I doing wrong?
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->setShortcut(QKeySequence::New);
newAction->setStatusTip(tr("Create new profile"));
connect(newAction, SIGNAL(triggered()), this, SLOT(newSlot()));
and the newSlot, slot:
void MainWindow::newSlot()
{
NewWizard wizard;
wizard.show();
}
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);
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);
}
But when I go to the menu and choose the new action, the wizard is not displayed. What am I doing wrong?