QSerialPortInfo Class▲
-
Header: QSerialPortInfo
-
Since: Qt 5.1
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS SerialPort)
target_link_libraries(mytarget PRIVATE Qt6::SerialPort)
-
qmake: QT += serialport
-
Group: QSerialPortInfo is part of serialport-main
Detailed Description▲
Use the static functions to generate a list of QSerialPortInfo objects. Each QSerialPortInfo object in the list represents a single serial port and can be queried for the port name, system location, description, and manufacturer. The QSerialPortInfo class can also be used as an input parameter for the setPort() method of the QSerialPort class.
See Also▲
See also QSerialPort
Member Function Documentation▲
QSerialPortInfo::QSerialPortInfo()▲
[explicit] QSerialPortInfo::QSerialPortInfo(const QSerialPort &port)▲
Constructs a QSerialPortInfo object from serial port.
[explicit] QSerialPortInfo::QSerialPortInfo(const QString &name)▲
Constructs a QSerialPortInfo object from serial port name.
This constructor finds the relevant serial port among the available ones according to the port name name, and constructs the serial port info instance for that port.
QSerialPortInfo::QSerialPortInfo(const QSerialPortInfo &other)▲
Constructs a copy of other.
QSerialPortInfo::~QSerialPortInfo()▲
Destroys the QSerialPortInfo object. References to the values in the object become invalid.
[static] QList<QSerialPortInfo> QSerialPortInfo::availablePorts()▲
Returns a list of available serial ports on the system.
QString QSerialPortInfo::description() const▲
Returns the description string of the serial port, if available; otherwise returns an empty string.
See Also▲
See also manufacturer(), serialNumber()
bool QSerialPortInfo::hasProductIdentifier() const▲
Returns true if there is a valid 16-bit product number present; otherwise returns false.
See Also▲
See also productIdentifier(), vendorIdentifier(), hasVendorIdentifier()
bool QSerialPortInfo::hasVendorIdentifier() const▲
Returns true if there is a valid 16-bit vendor number present; otherwise returns false.
See Also▲
See also vendorIdentifier(), productIdentifier(), hasProductIdentifier()
bool QSerialPortInfo::isNull() const▲
Returns whether this QSerialPortInfo object holds a serial port definition.
QString QSerialPortInfo::manufacturer() const▲
Returns the manufacturer string of the serial port, if available; otherwise returns an empty string.
See Also▲
See also description(), serialNumber()
QString QSerialPortInfo::portName() const▲
quint16 QSerialPortInfo::productIdentifier() const▲
Returns the 16-bit product number for the serial port, if available; otherwise returns zero.
See Also▲
See also hasProductIdentifier(), vendorIdentifier(), hasVendorIdentifier()
[since 5.3] QString QSerialPortInfo::serialNumber() const▲
Returns the serial number string of the serial port, if available; otherwise returns an empty string.
The serial number may include letters.
This function was introduced in Qt 5.3.
See Also▲
See also description(), manufacturer()
[static] QList<qint32> QSerialPortInfo::standardBaudRates()▲
Returns a list of available standard baud rates supported by the target platform.
void QSerialPortInfo::swap(QSerialPortInfo &other)▲
Swaps QSerialPortInfo other with this QSerialPortInfo. This operation is very fast and never fails.
QString QSerialPortInfo::systemLocation() const▲
quint16 QSerialPortInfo::vendorIdentifier() const▲
Returns the 16-bit vendor number for the serial port, if available; otherwise returns zero.
See Also▲
See also hasVendorIdentifier(), productIdentifier(), hasProductIdentifier()
QSerialPortInfo &QSerialPortInfo::operator=(const QSerialPortInfo &other)▲
Sets the QSerialPortInfo object to be equal to other.