summaryrefslogtreecommitdiffstats
path: root/examples/serialport/enumerator/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/serialport/enumerator/main.cpp')
-rw-r--r--examples/serialport/enumerator/main.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/examples/serialport/enumerator/main.cpp b/examples/serialport/enumerator/main.cpp
deleted file mode 100644
index 78cadc5a..00000000
--- a/examples/serialport/enumerator/main.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
-// Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include <QApplication>
-#include <QLabel>
-#include <QScrollArea>
-#include <QSerialPortInfo>
-#include <QVBoxLayout>
-#include <QWidget>
-
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
-
- auto layout = new QVBoxLayout;
-
- const auto infos = QSerialPortInfo::availablePorts();
- for (const QSerialPortInfo &info : infos) {
- QString s = QObject::tr("Port: ") + info.portName() + "\n"
- + QObject::tr("Location: ") + info.systemLocation() + "\n"
- + QObject::tr("Description: ") + info.description() + "\n"
- + QObject::tr("Manufacturer: ") + info.manufacturer() + "\n"
- + QObject::tr("Serial number: ") + info.serialNumber() + "\n"
- + QObject::tr("Vendor Identifier: ") + (info.hasVendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : QString()) + "\n"
- + QObject::tr("Product Identifier: ") + (info.hasProductIdentifier() ? QString::number(info.productIdentifier(), 16) : QString()) + "\n";
-
- auto label = new QLabel(s);
- layout->addWidget(label);
- }
-
- auto workPage = new QWidget;
- workPage->setLayout(layout);
-
- QScrollArea area;
- area.setWindowTitle(QObject::tr("Info about all available serial ports."));
- area.setWidget(workPage);
- area.show();
-
- return a.exec();
-}