File indexing completed on 2024-04-21 15:05:24
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 a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); 0018 0019 KAssistantDialog *dlg = new KAssistantDialog(); 0020 QObject::connect(dlg, &QDialog::finished, &a, &QCoreApplication::quit); 0021 for (int i = 1; i < 11; i++) { 0022 QWidget *p = new QWidget; 0023 QString msg = QStringLiteral("This is page %1 out of 10").arg(i); 0024 QLabel *label = new QLabel(msg, p); 0025 QHBoxLayout *layout = new QHBoxLayout(p); 0026 label->setAlignment(Qt::AlignCenter); 0027 label->setFixedSize(300, 200); 0028 layout->addWidget(label); 0029 QString title = QStringLiteral("%1. page").arg(i); 0030 dlg->addPage(p, title); 0031 } 0032 0033 dlg->show(); 0034 return a.exec(); 0035 }