Using Serial Port in QT4.8.4



  • Hello! I want to use serial port in Qt 4.8.4. I have come to know that QSerialPort has been included from Qt 5.1, but that cannot be used for my project. I tried searching the web but did not find it helpful. Kindly assist me in finding a solution.
    Thank you.

    Environment:

    Windows 8.1
    Visual Studio 2008 SP1 trial with Qt 4.8.4 Plugin
    Platform: Win CE 7


  • Moderators

    @Ejay Take a look at this: https://wiki.qt.io/Qt_Serial_Port
    You can build QtSerialport for Qt 4.8 as well.



  • I am facing trouble to install the QSerialPort libraries to Qt 4.8. So far i have no idea how to do it for windows


  • Qt Champions 2017

    @Ejay

    Hi
    Did you already compile it with vs 2008 ?



  • @mrjj I cloned the git repository for qt4-dev. I imported the .pro file with the Qt Addin and built it in VS2008. The built is successful, but i do not know how to make use of it as library


  • Qt Champions 2017

    @Ejay said in Using Serial Port in QT4.8.4:

    @mrjj I cloned the git repository for qt4-dev. I imported the .pro file with the Qt Addin and built it in VS2008. The built is successful, but i do not know how to make use of it as library

    the next step ist install. it should be something like nmake install. if you can't run it from VS, then you will have to open a Visual Studio Command Prompt.

    Afterwards it can be used by adding CONFIG+=SERIALPORT to your projects .pro file.

    I have done this some times by following the instructions mentioned earlier in this thread and it just worked.



  • If you want to have it for the WINCE7 target, then:

    • at first - you must to compile the Qt4.x for this target.
    • at second - integrate compiled Qt to VS2008, using addons.
    • at third - try to open the qtserialport.pro file in VS2008 for Qt with that WINCE7 target and try to compile.
    • at fourth - try to run the "nmake install" from the VS command line (or try to copy all required files to the compiled Qt4.x location, this already was discussed on this forum).

    In case you can not compile QSP from the *.pro file, then you can convert a *.pro file to the vsproj file (please read the qmake documentation), and try to open a ready vsproj from VS directly to build.

    UPD: I'm forgot to say - replace the WINCE to the LINUX BSP, it will be a best way, which will save of your nerves and time. :)

    Especially, if it is your comment: https://www.toradex.com/community/questions/18488/using-serial-port-in-qt-484-with-vs2008.html :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.