File indexing completed on 2024-04-21 15:05:25

0001 /*
0002     This file is part of the KDE Libraries
0003     SPDX-FileCopyrightText: 2006 Tobias Koenig <tokoe@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "kpagedialogtest.h"
0009 
0010 #include <QApplication>
0011 #include <QBoxLayout>
0012 #include <QLabel>
0013 
0014 KPageDialogTest::KPageDialogTest(QWidget *parent)
0015     : KPageDialog(parent)
0016 {
0017     setFaceType(Tabbed);
0018 
0019     QWidget *page = new QWidget(this);
0020     QBoxLayout *layout = new QVBoxLayout(page);
0021 
0022     QLabel *label = new QLabel(QStringLiteral("first page"));
0023     layout->addWidget(label);
0024 
0025     label = new QLabel(QStringLiteral("This is a very long text that is contained in a single string within a single label"));
0026     layout->addWidget(label);
0027 
0028     addPage(page, QStringLiteral("First"));
0029 
0030     page = new QWidget(this);
0031     layout = new QHBoxLayout(page);
0032 
0033     label = new QLabel(QStringLiteral("second page"));
0034     label->setMinimumSize(300, 200);
0035     layout->addWidget(label);
0036 
0037     addPage(page, QStringLiteral("Second"));
0038 }
0039 
0040 KPageDialogTest::~KPageDialogTest()
0041 {
0042 }
0043 
0044 int main(int argc, char **argv)
0045 {
0046     QApplication::setApplicationName(QStringLiteral("KPageDialogTest"));
0047 
0048     QApplication app(argc, argv);
0049     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
0050 
0051     KPageDialogTest testDialog(nullptr);
0052     testDialog.exec();
0053 
0054     return 0;
0055 }
0056 
0057 #include "moc_kpagedialogtest.cpp"