| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| 3 | |
| 4 | #include <QtWidgets/qapplication.h> |
| 5 | |
| 6 | #include "mainwindow.h" |
| 7 | |
| 8 | using namespace Qt::StringLiterals; |
| 9 | |
| 10 | int main(int argc, char *argv[]) |
| 11 | { |
| 12 | QApplication app(argc, argv); |
| 13 | |
| 14 | QCoreApplication::setOrganizationName(u"QtProject"_s); |
| 15 | QCoreApplication::setApplicationName(u"QDBusViewer"_s); |
| 16 | |
| 17 | MainWindow mw; |
| 18 | #if !defined(Q_OS_MACOS) && !defined(Q_OS_WIN) |
| 19 | app.setWindowIcon(QIcon(":/qt-project.org/qdbusviewer/images/qdbusviewer.png"_L1)); |
| 20 | #endif |
| 21 | #ifdef Q_OS_MACOS |
| 22 | mw.setWindowTitle(qApp->translate("QtDBusViewer", "Qt D-Bus Viewer")); |
| 23 | #endif |
| 24 | |
| 25 | QStringList args = app.arguments(); |
| 26 | while (args.size()) { |
| 27 | QString arg = args.takeFirst(); |
| 28 | if (arg == "--bus"_L1) |
| 29 | mw.addCustomBusTab(bus: args.takeFirst()); |
| 30 | } |
| 31 | |
| 32 | mw.show(); |
| 33 | |
| 34 | return app.exec(); |
| 35 | } |
| 36 |
