File indexing completed on 2024-04-28 03:59:17
0001 /* 0002 kassistantdialogtest - a test program for the KAssistantDialog class 0003 SPDX-FileCopyrightText: 1998 Thomas Tanghus <tanghus@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #include <QApplication> 0009 #include <QHBoxLayout> 0010 #include <QLabel> 0011 #include <kassistantdialog.h> 0012 0013 int main(int argc, char **argv) 0014 { 0015 QApplication::setApplicationName(QStringLiteral("test")); 0016 QApplication a(argc, argv); 0017 0018 KAssistantDialog *dlg = new KAssistantDialog(); 0019 QObject::connect(dlg, &QDialog::finished, &a, &QCoreApplication::quit); 0020 for (int i = 1; i < 11; i++) { 0021 QWidget *p = new QWidget; 0022 QString msg = QStringLiteral("This is page %1 out of 10").arg(i); 0023 QLabel *label = new QLabel(msg, p); 0024 QHBoxLayout *layout = new QHBoxLayout(p); 0025 label->setAlignment(Qt::AlignCenter); 0026 label->setFixedSize(300, 200); 0027 layout->addWidget(label); 0028 QString title = QStringLiteral("%1. page").arg(i); 0029 dlg->addPage(p, title); 0030 } 0031 0032 dlg->show(); 0033 return a.exec(); 0034 }