From eea4f8fb9c40e345e87e4ebbdcab4ba07967f279 Mon Sep 17 00:00:00 2001 From: Michael Carpenter Date: Tue, 16 Jul 2013 11:41:29 -0400 Subject: [PATCH] Changes for compiling QSerialPort based communications library in windows --- libs/serialport/qserialportglobal.h | 4 ++-- src/ui/XbeeConfigurationWindow.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/serialport/qserialportglobal.h b/libs/serialport/qserialportglobal.h index 03cd6a62b..34c5ba4ff 100644 --- a/libs/serialport/qserialportglobal.h +++ b/libs/serialport/qserialportglobal.h @@ -51,12 +51,12 @@ QT_BEGIN_NAMESPACE # if defined(QT_BUILD_SERIALPORT_LIB) # define Q_SERIALPORT_EXPORT Q_DECL_EXPORT # else -# define Q_SERIALPORT_EXPORT Q_DECL_IMPORT +//# define Q_SERIALPORT_EXPORT Q_DECL_IMPORT # endif #else # define Q_SERIALPORT_EXPORT #endif - +# define Q_SERIALPORT_EXPORT // The macro has been available only since Qt 5.0 #ifndef Q_DECL_OVERRIDE #define Q_DECL_OVERRIDE diff --git a/src/ui/XbeeConfigurationWindow.cpp b/src/ui/XbeeConfigurationWindow.cpp index 7be847ac6..691026188 100644 --- a/src/ui/XbeeConfigurationWindow.cpp +++ b/src/ui/XbeeConfigurationWindow.cpp @@ -8,7 +8,8 @@ #include #ifdef _WIN32 -#include +//#include +#include #endif #if defined (__APPLE__) && defined (__MACH__) @@ -368,11 +369,12 @@ void XbeeConfigurationWindow::setupPortList() #ifdef _WIN32 // Get the ports available on this system - QList ports = QextSerialEnumerator::getPorts(); + QList ports = QSerialPortInfo::availablePorts(); + //QList ports = QextSerialEnumerator::getPorts(); // Add the ports in reverse order, because we prepend them to the list for (int i = ports.size() - 1; i >= 0; i--) { - QString portString = QString(ports.at(i).portName.toLocal8Bit().constData()) + " - " + QString(ports.at(i).friendName.toLocal8Bit().constData()).split("(").first(); + QString portString = QString(ports.at(i).portName.toLocal8Bit().constData()); // Prepend newly found port to the list if (portBox->findText(portString) == -1) { portBox->insertItem(0, portString); -- 2.22.0