File indexing completed on 2024-05-19 05:35:23

0001 //////////////////////////////////////////////////////////////////////////////
0002 // main.cpp
0003 // oxygen-demo main
0004 // -------------------
0005 //
0006 // SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0007 //
0008 // SPDX-License-Identifier: MIT
0009 //////////////////////////////////////////////////////////////////////////////
0010 
0011 #include "../oxygen.h"
0012 #include "config-liboxygen.h"
0013 #include "oxygendemodialog.h"
0014 
0015 #include <QApplication>
0016 #include <QCommandLineOption>
0017 #include <QCommandLineParser>
0018 #include <QIcon>
0019 
0020 #include <KLocalizedString>
0021 
0022 namespace Oxygen
0023 {
0024 int run(int argc, char *argv[])
0025 {
0026     QApplication app(argc, argv);
0027 
0028     QCommandLineParser commandLine;
0029 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0030     QCommandLineOption enableHighDpi(QStringLiteral("highdpi"), QStringLiteral("Enable High DPI pixmaps"));
0031     commandLine.addOption(enableHighDpi);
0032 #endif
0033     commandLine.process(app);
0034 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0035     app.setAttribute(Qt::AA_UseHighDpiPixmaps, commandLine.isSet(enableHighDpi));
0036 #endif
0037     app.setApplicationName(i18n("Oxygen Demo"));
0038     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("oxygen")));
0039     DemoDialog dialog;
0040     dialog.show();
0041     bool result = app.exec();
0042     return result;
0043 }
0044 }
0045 
0046 //__________________________________________
0047 int main(int argc, char *argv[])
0048 {
0049     KLocalizedString::setApplicationDomain("oxygen_style_demo");
0050 
0051     return Oxygen::run(argc, argv);
0052 }