summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-01-27 16:45:42 +0100
committerIvan Solovev <ivan.solovev@qt.io>2023-02-02 16:17:21 +0000
commit8af718f650224fd8f4f482e9a4bccfe65aa2038d (patch)
tree7eb1c88346aed2622e849545761b21c824af0f6f
parent1eb296a0d1cc2f517f0c0469697f78e3f38d65e9 (diff)
Remove duplicated examples
The console reader and writer examples have UI versions. The gist of the enumerator examples is directly shown in the QSerialPortInfo class documentation. Task-number: QTBUG-110645 Pick-to: 6.5 Change-Id: I0f496ddd1e598fc8a5636ac72aa65f99baee561a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--examples/serialport/CMakeLists.txt4
-rw-r--r--examples/serialport/cenumerator/CMakeLists.txt35
-rw-r--r--examples/serialport/cenumerator/cenumerator.pro14
-rw-r--r--examples/serialport/cenumerator/main.cpp38
-rw-r--r--examples/serialport/creadersync/CMakeLists.txt35
-rw-r--r--examples/serialport/creadersync/creadersync.pro14
-rw-r--r--examples/serialport/creadersync/main.cpp57
-rw-r--r--examples/serialport/cwritersync/CMakeLists.txt35
-rw-r--r--examples/serialport/cwritersync/cwritersync.pro14
-rw-r--r--examples/serialport/cwritersync/main.cpp78
-rw-r--r--examples/serialport/doc/cenumerator.qdoc23
-rw-r--r--examples/serialport/doc/creadersync.qdoc25
-rw-r--r--examples/serialport/doc/cwritersync.qdoc25
-rw-r--r--examples/serialport/doc/enumerator.qdoc23
-rw-r--r--examples/serialport/enumerator/CMakeLists.txt37
-rw-r--r--examples/serialport/enumerator/enumerator.pro10
-rw-r--r--examples/serialport/enumerator/main.cpp41
-rw-r--r--examples/serialport/serialport.pro4
-rw-r--r--src/serialport/doc/images/cenumerator-example.pngbin3532 -> 0 bytes
-rw-r--r--src/serialport/doc/images/creadersync-example.pngbin13638 -> 0 bytes
-rw-r--r--src/serialport/doc/images/cwritersync-example.pngbin12653 -> 0 bytes
-rw-r--r--src/serialport/doc/images/enumerator-example.pngbin15557 -> 0 bytes
22 files changed, 2 insertions, 510 deletions
diff --git a/examples/serialport/CMakeLists.txt b/examples/serialport/CMakeLists.txt
index aa16ae74..24c61754 100644
--- a/examples/serialport/CMakeLists.txt
+++ b/examples/serialport/CMakeLists.txt
@@ -1,13 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-qt_internal_add_example(cenumerator)
qt_internal_add_example(creaderasync)
-qt_internal_add_example(creadersync)
qt_internal_add_example(cwriterasync)
-qt_internal_add_example(cwritersync)
if((((NOT QT.widgets.name_ISEMPTY))))
- qt_internal_add_example(enumerator)
qt_internal_add_example(terminal)
qt_internal_add_example(blockingsender)
qt_internal_add_example(blockingreceiver)
diff --git a/examples/serialport/cenumerator/CMakeLists.txt b/examples/serialport/cenumerator/CMakeLists.txt
deleted file mode 100644
index 3aa713fd..00000000
--- a/examples/serialport/cenumerator/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(cenumerator LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/serialport/cenumerator")
-
-find_package(Qt6 REQUIRED COMPONENTS Core SerialPort)
-
-qt_add_executable(cenumerator
- main.cpp
-)
-
-set_target_properties(cenumerator PROPERTIES
- WIN32_EXECUTABLE FALSE
- MACOSX_BUNDLE FALSE
-)
-
-target_link_libraries(cenumerator PRIVATE
- Qt::Core
- Qt::SerialPort
-)
-
-install(TARGETS cenumerator
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/serialport/cenumerator/cenumerator.pro b/examples/serialport/cenumerator/cenumerator.pro
deleted file mode 100644
index 75a43e36..00000000
--- a/examples/serialport/cenumerator/cenumerator.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-QT = core
-QT += serialport
-
-CONFIG += console
-CONFIG -= app_bundle
-
-TARGET = cenumerator
-TEMPLATE = app
-
-SOURCES += \
- main.cpp
-
-target.path = $$[QT_INSTALL_EXAMPLES]/serialport/cenumerator
-INSTALLS += target
diff --git a/examples/serialport/cenumerator/main.cpp b/examples/serialport/cenumerator/main.cpp
deleted file mode 100644
index fc8fd9b3..00000000
--- a/examples/serialport/cenumerator/main.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include <QCoreApplication>
-#include <QSerialPortInfo>
-#include <QTextStream>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication coreApplication(argc, argv);
- QTextStream out(stdout);
- const auto serialPortInfos = QSerialPortInfo::availablePorts();
-
- out << "Total number of ports available: " << serialPortInfos.count() << Qt::endl;
-
- const QStringView blankString = u"N/A";
-
- for (const QSerialPortInfo &serialPortInfo : serialPortInfos) {
- const QStringView description = serialPortInfo.description();
- const QStringView manufacturer = serialPortInfo.manufacturer();
- const QStringView serialNumber = serialPortInfo.serialNumber();
-
- out << Qt::endl
- << "Port: " << serialPortInfo.portName() << Qt::endl
- << "Location: " << serialPortInfo.systemLocation() << Qt::endl
- << "Description: " << (!description.isEmpty() ? description : blankString) << Qt::endl
- << "Manufacturer: " << (!manufacturer.isEmpty() ? manufacturer : blankString) << Qt::endl
- << "Serial number: " << (!serialNumber.isEmpty() ? serialNumber : blankString) << Qt::endl
- << "Vendor Identifier: " << (serialPortInfo.hasVendorIdentifier()
- ? QByteArray::number(serialPortInfo.vendorIdentifier(), 16)
- : blankString.toLatin1()) << Qt::endl
- << "Product Identifier: " << (serialPortInfo.hasProductIdentifier()
- ? QByteArray::number(serialPortInfo.productIdentifier(), 16)
- : blankString.toLatin1()) << Qt::endl;
- }
-
- return 0;
-}
diff --git a/examples/serialport/creadersync/CMakeLists.txt b/examples/serialport/creadersync/CMakeLists.txt
deleted file mode 100644
index 48714310..00000000
--- a/examples/serialport/creadersync/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(creadersync LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/serialport/creadersync")
-
-find_package(Qt6 REQUIRED COMPONENTS Core SerialPort)
-
-qt_add_executable(creadersync
- main.cpp
-)
-
-set_target_properties(creadersync PROPERTIES
- WIN32_EXECUTABLE FALSE
- MACOSX_BUNDLE FALSE
-)
-
-target_link_libraries(creadersync PRIVATE
- Qt::Core
- Qt::SerialPort
-)
-
-install(TARGETS creadersync
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/serialport/creadersync/creadersync.pro b/examples/serialport/creadersync/creadersync.pro
deleted file mode 100644
index a2690aaf..00000000
--- a/examples/serialport/creadersync/creadersync.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-QT = core
-QT += serialport
-
-CONFIG += console
-CONFIG -= app_bundle
-
-TARGET = creadersync
-TEMPLATE = app
-
-SOURCES += \
- main.cpp
-
-target.path = $$[QT_INSTALL_EXAMPLES]/serialport/creadersync
-INSTALLS += target
diff --git a/examples/serialport/creadersync/main.cpp b/examples/serialport/creadersync/main.cpp
deleted file mode 100644
index 72499eaa..00000000
--- a/examples/serialport/creadersync/main.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include <QCoreApplication>
-#include <QSerialPort>
-#include <QStringList>
-#include <QTextStream>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication coreApplication(argc, argv);
- const int argumentCount = QCoreApplication::arguments().size();
- const QStringList argumentList = QCoreApplication::arguments();
-
- QTextStream standardOutput(stdout);
-
- if (argumentCount == 1) {
- standardOutput << QObject::tr("Usage: %1 <serialportname> [baudrate]")
- .arg(argumentList.first()) << Qt::endl;
- return 1;
- }
-
- QSerialPort serialPort;
- const QString serialPortName = argumentList.at(1);
- serialPort.setPortName(serialPortName);
-
- const int serialPortBaudRate = (argumentCount > 2)
- ? argumentList.at(2).toInt() : QSerialPort::Baud9600;
- serialPort.setBaudRate(serialPortBaudRate);
-
- if (!serialPort.open(QIODevice::ReadOnly)) {
- standardOutput << QObject::tr("Failed to open port %1, error: %2")
- .arg(serialPortName).arg(serialPort.error()) << Qt::endl;
- return 1;
- }
-
- QByteArray readData = serialPort.readAll();
- while (serialPort.waitForReadyRead(5000))
- readData.append(serialPort.readAll());
-
- if (serialPort.error() == QSerialPort::ReadError) {
- standardOutput << QObject::tr("Failed to read from port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
- return 1;
- } else if (serialPort.error() == QSerialPort::TimeoutError && readData.isEmpty()) {
- standardOutput << QObject::tr("No data was currently available"
- " for reading from port %1")
- .arg(serialPortName) << Qt::endl;
- return 0;
- }
-
- standardOutput << QObject::tr("Data successfully received from port %1")
- .arg(serialPortName) << Qt::endl;
- standardOutput << readData << Qt::endl;
-
- return 0;
-}
diff --git a/examples/serialport/cwritersync/CMakeLists.txt b/examples/serialport/cwritersync/CMakeLists.txt
deleted file mode 100644
index 7c1850c0..00000000
--- a/examples/serialport/cwritersync/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(cwritersync LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/serialport/cwritersync")
-
-find_package(Qt6 REQUIRED COMPONENTS Core SerialPort)
-
-qt_add_executable(cwritersync
- main.cpp
-)
-
-set_target_properties(cwritersync PROPERTIES
- WIN32_EXECUTABLE FALSE
- MACOSX_BUNDLE FALSE
-)
-
-target_link_libraries(cwritersync PRIVATE
- Qt::Core
- Qt::SerialPort
-)
-
-install(TARGETS cwritersync
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/serialport/cwritersync/cwritersync.pro b/examples/serialport/cwritersync/cwritersync.pro
deleted file mode 100644
index 1e0996dc..00000000
--- a/examples/serialport/cwritersync/cwritersync.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-QT = core
-QT += serialport
-
-CONFIG += console
-CONFIG -= app_bundle
-
-TARGET = cwritersync
-TEMPLATE = app
-
-SOURCES += \
- main.cpp
-
-target.path = $$[QT_INSTALL_EXAMPLES]/serialport/cwritersync
-INSTALLS += target
diff --git a/examples/serialport/cwritersync/main.cpp b/examples/serialport/cwritersync/main.cpp
deleted file mode 100644
index 0eb9a90a..00000000
--- a/examples/serialport/cwritersync/main.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include <QCoreApplication>
-#include <QFile>
-#include <QSerialPort>
-#include <QStringList>
-#include <QTextStream>
-
-int main(int argc, char *argv[])
-{
- QCoreApplication coreApplication(argc, argv);
- const int argumentCount = QCoreApplication::arguments().size();
- const QStringList argumentList = QCoreApplication::arguments();
-
- QTextStream standardOutput(stdout);
-
- if (argumentCount == 1) {
- standardOutput << QObject::tr("Usage: %1 <serialportname> [baudrate]")
- .arg(argumentList.first()) << Qt::endl;
- return 1;
- }
-
- QSerialPort serialPort;
- const QString serialPortName = argumentList.at(1);
- serialPort.setPortName(serialPortName);
-
- const int serialPortBaudRate = (argumentCount > 2)
- ? argumentList.at(2).toInt() : QSerialPort::Baud9600;
- serialPort.setBaudRate(serialPortBaudRate);
-
- if (!serialPort.open(QIODevice::WriteOnly)) {
- standardOutput << QObject::tr("Failed to open port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString())
- << Qt::endl;
- return 1;
- }
-
- QFile dataFile;
- if (!dataFile.open(stdin, QIODevice::ReadOnly)) {
- standardOutput << QObject::tr("Failed to open stdin for reading")
- << Qt::endl;
- return 1;
- }
-
- QByteArray writeData(dataFile.readAll());
- dataFile.close();
-
- if (writeData.isEmpty()) {
- standardOutput << QObject::tr("Either no data was currently available on "
- "the standard input for reading, or an error "
- "occurred for port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
- return 1;
- }
-
- const qint64 bytesWritten = serialPort.write(writeData);
-
- if (bytesWritten == -1) {
- standardOutput << QObject::tr("Failed to write the data to port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
- return 1;
- } else if (bytesWritten != writeData.size()) {
- standardOutput << QObject::tr("Failed to write all the data to port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
- return 1;
- } else if (!serialPort.waitForBytesWritten(5000)) {
- standardOutput << QObject::tr("Operation timed out or an error "
- "occurred for port %1, error: %2")
- .arg(serialPortName).arg(serialPort.errorString()) << Qt::endl;
- return 1;
- }
-
- standardOutput << QObject::tr("Data successfully sent to port %1")
- .arg(serialPortName) << Qt::endl;
-
- return 0;
-}
diff --git a/examples/serialport/doc/cenumerator.qdoc b/examples/serialport/doc/cenumerator.qdoc
deleted file mode 100644
index f07a79a6..00000000
--- a/examples/serialport/doc/cenumerator.qdoc
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example cenumerator
- \title Command Line Enumerator Example
- \ingroup qtserialport-examples
- \brief Shows how to get information about serial devices in a system.
-
- \e{Command Line Enumerator} shows how to use the class QSerialPortInfo for
- getting information about serial devices that are present in the system.
-
- \image cenumerator-example.png
-
- This command line example displays information about serial ports in a
- console, provided by the class QSerialPortInfo.
-
- For getting information about the available ports, use the static method
- \l{QSerialPortInfo::availablePorts()}{availablePorts()}.
-
- \include examples-run.qdocinc
-*/
diff --git a/examples/serialport/doc/creadersync.qdoc b/examples/serialport/doc/creadersync.qdoc
deleted file mode 100644
index f2f3fd8e..00000000
--- a/examples/serialport/doc/creadersync.qdoc
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example creadersync
- \title Command Line Reader Sync Example
- \ingroup qtserialport-examples
- \brief Shows how to receive data synchronously over serial port.
-
- \e{Command Line Reader Sync} shows how to use the QSerialPort class
- for receiving data synchronously over the selected serial port with the
- desired settings.
-
- \image creadersync-example.png
-
- This command line reader sync example receives data synchronously over the
- selected serial port in a console, provided by the QSerialPort class.
-
- For receiving data synchronously over the selected serial port, use the
- \l{QSerialPort::read()}{read()} or \l{QSerialPort::readAll()}{readAll()},
- and \l{QIODevice::waitForReadyRead()}{waitForReadyRead()} methods.
-
- \include examples-run.qdocinc
-*/
diff --git a/examples/serialport/doc/cwritersync.qdoc b/examples/serialport/doc/cwritersync.qdoc
deleted file mode 100644
index 1cbb5a65..00000000
--- a/examples/serialport/doc/cwritersync.qdoc
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example cwritersync
- \title Command Line Writer Sync Example
- \ingroup qtserialport-examples
- \brief Shows how to send data synchronously over serial port.
-
- \e{Command Line Writer Sync} shows how to use the QSerialPort class for
- sending data synchronously over the selected serial port with the desired
- settings.
-
- \image cwritersync-example.png
-
- This command line writer sync example sends data synchronously over the
- selected serial port in a console, provided by the QSerialPort class.
-
- For sending data synchronously over the selected serial port, use the
- \l{QIODevice::write()}{write()} and
- \l{QIODevice::waitForBytesWritten()}{waitForBytesWritten()} methods.
-
- \include examples-run.qdocinc
-*/
diff --git a/examples/serialport/doc/enumerator.qdoc b/examples/serialport/doc/enumerator.qdoc
deleted file mode 100644
index cdb494ed..00000000
--- a/examples/serialport/doc/enumerator.qdoc
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (C) 2011 - 2012 Denis Shienkov <denis.shienkov@gmail.com>
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example enumerator
- \title Enumerator Example
- \ingroup qtserialport-examples
- \brief Shows how to display information about serial devices in a system.
-
- \e Enumerator shows how to use the class QSerialPortInfo for
- getting information about serial devices that are present in the system.
-
- \image enumerator-example.png
-
- This GUI example displays information about serial ports in a widget,
- provided by the class QSerialPortInfo.
-
- For getting information about the available ports, use the static method
- \l{QSerialPortInfo::availablePorts()}{availablePorts()}.
-
- \include examples-run.qdocinc
-*/
diff --git a/examples/serialport/enumerator/CMakeLists.txt b/examples/serialport/enumerator/CMakeLists.txt
deleted file mode 100644
index ca88ab24..00000000
--- a/examples/serialport/enumerator/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(enumerator LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/serialport/enumerator")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui SerialPort Widgets)
-
-qt_add_executable(enumerator
- main.cpp
-)
-
-set_target_properties(enumerator PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(enumerator PRIVATE
- Qt::Core
- Qt::Gui
- Qt::SerialPort
- Qt::Widgets
-)
-
-install(TARGETS enumerator
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/serialport/enumerator/enumerator.pro b/examples/serialport/enumerator/enumerator.pro
deleted file mode 100644
index 3989335a..00000000
--- a/examples/serialport/enumerator/enumerator.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-QT += widgets serialport
-
-TARGET = enumerator
-TEMPLATE = app
-
-SOURCES += \
- main.cpp
-
-target.path = $$[QT_INSTALL_EXAMPLES]/serialport/enumerator
-INSTALLS += target
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();
-}
diff --git a/examples/serialport/serialport.pro b/examples/serialport/serialport.pro
index d04911a7..98d9d7e0 100644
--- a/examples/serialport/serialport.pro
+++ b/examples/serialport/serialport.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = cenumerator creaderasync creadersync cwriterasync cwritersync
-!isEmpty(QT.widgets.name):SUBDIRS += enumerator terminal blockingsender blockingreceiver sender receiver
+SUBDIRS = creaderasync cwriterasync
+!isEmpty(QT.widgets.name):SUBDIRS += terminal blockingsender blockingreceiver sender receiver
diff --git a/src/serialport/doc/images/cenumerator-example.png b/src/serialport/doc/images/cenumerator-example.png
deleted file mode 100644
index 03792e71..00000000
--- a/src/serialport/doc/images/cenumerator-example.png
+++ /dev/null
Binary files differ
diff --git a/src/serialport/doc/images/creadersync-example.png b/src/serialport/doc/images/creadersync-example.png
deleted file mode 100644
index 476dcbe4..00000000
--- a/src/serialport/doc/images/creadersync-example.png
+++ /dev/null
Binary files differ
diff --git a/src/serialport/doc/images/cwritersync-example.png b/src/serialport/doc/images/cwritersync-example.png
deleted file mode 100644
index 669985d2..00000000
--- a/src/serialport/doc/images/cwritersync-example.png
+++ /dev/null
Binary files differ
diff --git a/src/serialport/doc/images/enumerator-example.png b/src/serialport/doc/images/enumerator-example.png
deleted file mode 100644
index c96d990c..00000000
--- a/src/serialport/doc/images/enumerator-example.png
+++ /dev/null
Binary files differ