fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kde3support / tests / k3wizardtest.cpp
blob1778f3ece60badf14771baddc6005c9ac6cf2ee5
1 /*
2 * kwizardtest - a test program for the KWizard dialog
3 * Copyright (C) 1998 Thomas Tanghus (tanghus@kde.org)
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include <QtGui/QLabel>
22 #include <QtGui/QLayout>
23 //Added by qt3to4:
24 #include <QtGui/QBoxLayout>
25 #include <kcmdlineargs.h>
26 #include <kapplication.h>
27 #include <k3wizard.h>
29 int main(int argc, char **argv)
31 KCmdLineArgs::init( argc, argv, "test", 0, ki18n("Test"), "1.0", ki18n("test app"));
32 KApplication a;
33 K3Wizard *wiz = new K3Wizard(0, "kwizardtest", false);
34 QObject::connect((QObject*) wiz->cancelButton(), SIGNAL(clicked()),
35 &a, SLOT(quit()));
36 QObject::connect((QObject*) wiz->finishButton(), SIGNAL(clicked()),
37 &a, SLOT(quit()));
38 for(int i = 1; i < 11; i++)
40 QWidget *p = new QWidget;
41 QString msg = QString("This is page %1 out of 10").arg(i);
42 QLabel *label = new QLabel(msg, p);
43 QHBoxLayout *layout = new QHBoxLayout(p, 5);
44 label->setAlignment(Qt::AlignCenter);
45 label->setFixedSize(300, 200);
46 layout->addWidget(label);
47 QString title = QString("%1. page").arg(i);
48 wiz->addPage(p, title);
49 wiz->setFinishEnabled(p, (i==10));
52 wiz->show();
53 return a.exec();