Warning, file /frameworks/kwidgetsaddons/tests/kfontrequestertest.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2013 David Edmundson <davidedmundson@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #include <QApplication>
0009 #include <QVBoxLayout>
0010 
0011 #include <kfontrequester.h>
0012 
0013 class KFontRequesterTest : public QWidget
0014 {
0015 public:
0016     KFontRequesterTest(QWidget *parent = nullptr)
0017         : QWidget(parent)
0018     {
0019         QVBoxLayout *mainLayout = new QVBoxLayout(this);
0020 
0021         KFontRequester *test1 = new KFontRequester(this);
0022         mainLayout->addWidget(test1);
0023 
0024         KFontRequester *test2 = new KFontRequester(this);
0025         test2->setSampleText(QStringLiteral("This is different sample text"));
0026         test2->setTitle(QStringLiteral("A different title"));
0027         test2->setFont(QFont(QStringLiteral("comic-sans"), 12, 1));
0028 
0029         mainLayout->addWidget(test2);
0030     }
0031 };
0032 
0033 int main(int argc, char **argv)
0034 {
0035     QApplication::setApplicationName(QStringLiteral("kfontrequestertest"));
0036     QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
0037     QApplication app(argc, argv);
0038 
0039     KFontRequesterTest *mainWidget = new KFontRequesterTest;
0040     mainWidget->show();
0041 
0042     return app.exec();
0043 }