Eventviews

main.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "mainwindow.h"
8
9#include <KAboutData>
10
11#include <KLocalizedString>
12#include <QApplication>
13#include <QCommandLineOption>
14#include <QCommandLineParser>
15
16int main(int argc, char **argv)
17{
18 KAboutData about(QStringLiteral("viewerapp"),
19 i18n("ViewerApp"),
20 QStringLiteral("0.1"),
21 i18n("A test app for embedding calendarviews"),
23 i18n("Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net"));
24 about.addAuthor(i18nc("@info:credit", "Kevin Krammer"), QString(), QStringLiteral("krake@kdab.com"));
25
26 QCommandLineParser parser;
27 QApplication app(argc, argv);
28 parser.addVersionOption();
29 parser.addHelpOption();
30 about.setupCommandLine(&parser);
31 parser.process(app);
32 about.processCommandLine(&parser);
33 parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[viewname]"), i18nc("@info:shell", "Optional list of view names to instantiate")));
34
35 QStringList viewNames;
36 for (int i = 0; i < parser.positionalArguments().count(); ++i) {
37 viewNames << parser.positionalArguments().at(i).toLower();
38 }
39
40 MainWindow *widget = new MainWindow(viewNames);
41
42 widget->show();
43
44 return app.exec();
45}
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
QCommandLineOption addHelpOption()
bool addOption(const QCommandLineOption &option)
QCommandLineOption addVersionOption()
QStringList positionalArguments() const const
void process(const QCoreApplication &app)
const_reference at(qsizetype i) const const
void show()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.