Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QtSerialPort...
Qt 6.11 is out! See what's new in the release blog

QtSerialPort...

Scheduled Pinned Locked Moved 3rd Party Software
10 Posts 3 Posters 9.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    valerio.j
    wrote on last edited by
    #1

    Hi Qt's,

    I'm trying to build my first Qt user interface using QtSerialPort. I'm having issues trying to understand how to integrate the library as explained in "QtSerialPort":http://qt-project.org/wiki/QtSerialPort into my project, but for the moment I'm just trying to run the terminal example (by itself) that comes with the download. I also found this post "QtSerialPort Lib":http://www.qtcentre.org/threads/49716-Adding-QtSerialPort-as-a-library with some good information in it, but I just can't get it going or understand it correctly.

    What I've done so far is:

    1. Downloaded the package as explained in the QtSerialPort wiki, I saved the uncompressed folder into C:\myQt\qtplayground-qtserialport.
    2. Next I opened Qt Creator and opened the Qt project file serialport.pro located in the C:\myQt\qtplayground-qtserialport directory.
    3. Successfully built serialport.pro and all sub-projects. Every example project compiles and runs just fine if I run them from serialport.pro, if I try to open any of the example projects independently then I run into problems.
    4. Two folders (debug and release) have been created on the C:\myQt directory, they are serialport-build-desktop-Qt_4_8_1_for_Desktop_-MinGW__Qt_SDK__Debug and serialport-build-desktop-Qt_4_8_1_for_Desktop-_MinGW__Qt_SDK__Release.

    Now here is the part I get stuck with or maybe I'm missing a step or doing something wrong.
    for example, I opened the terminal example which is in C:\myQt\qtplayground-qtserialport\examples\terminal.pro, but I get compile errors.
    I'm frustrated at this point and can't find good or better instructions (simpler or idiot proof...) that can get me going. My Idea is to be able to create my project, which I already started, and saved in C:\myQt\serialCommTest and be able to compile it and run it. Not sure if I'm making myself clear, but hope someone can give me a hand. I've used the serial port in C# in the past and don't remember being this difficult for me to set it up.

    System Specs:
    Win7 64 bit
    Qt Creator 2.4.1
    Qt 4.8.1 for Desktop MinGW (Qt SDK)

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      What kind errors you got?
      I have same tools version and OS as yours, and QtSerialPort lib and example projects works fine.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kuzulis
        Qt Champions 2020
        wrote on last edited by
        #3

        2DominicanTech,

        To open examples directly (or create custom user Qt project) it is necessary to have the previously installed QtSerialPort library. On Wiki is described process of installation of library after building.

        bq. cd serialport-build-release // install release build
        make install (or nmake install)
        cd ..
        cd serialport-build-debug // install debug build
        make install (or nmake install)

        Note, at using MinGW compiler, instead of make need write mingw32-make.

        PS: I.e after installation, you should appear new *.dll serialport libraries and headers into Qt \bin \lib and \include directories. Please check it after installation.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          valerio.j
          wrote on last edited by
          #4

          Yes thanks i got it working last night like 10 minutes after i posted this thread. What my problem was running make instead of mingw32-make. Ive edited the wiki to reflect this. Now my question is about documentation, is there a wiki or something with all the classes in qtserialport? Ive got my arduino sending data now to a small qt app that i slowly built from the examples,but having api doc will benice. I have the documentaion for qserialdevice but its different.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kuzulis
            Qt Champions 2020
            wrote on last edited by
            #5

            Documentation need generate independently.

            Just cd to /qtserialport/doc/ and modify file serialport.qdoccof, instead

            bq. indexes = $QT5DOC/doc/html/qt.index

            need write path to qt.index file, example:

            bq. indexes = < path to index > /qt.index

            where qt.index can be take from Qt sources from /doc/html directory.

            And finally need from console make:

            bq. $doc serialport.qdocconf

            1 Reply Last reply
            0
            • V Offline
              V Offline
              valerio.j
              wrote on last edited by
              #6

              Ok here is what I did and couldn't get it working.

              1.Opened the serialport.qdocconf with Qt Creator and made below changes:
              @#indexes = $QT5DOC/doc/html/qt.index
              indexes = C:/QtSDK/readme/qt-sdk.index@

              2.Opened the Qt 4.8.1 for Desktop (MingGW) command promtp and try to make
              but I get an error when I run the make command. I run mingw32-make serialport.qdocconf
              and get this error:
              mingw32-make: Nothing to be done for 'serialport.qdocconf'.

              I got it now, thanks.
              I found your other post "SerialOortDoc Gen":http://www.qtcentre.org/threads/49964-Way-to-check-for-input-data-from-serial-port-without-polling-in-main

              I had to run qdoc3 command instead. I got a bunch of errors during the build

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kuzulis
                Qt Champions 2020
                wrote on last edited by
                #7

                bq. I had to run qdoc3 command instead.

                Yes, it needs to be used.

                bq. indexes = C:/QtSDK/readme/qt-sdk.index
                bq. I got a bunch of errors during the build

                This qt-sdk.index is not that which is necessary.

                I to you clearly told what to take qt.index it is necessary from Qt source codes from a directory /doc/html.

                I.e. you should, for example, download like "qt-everywhere-opensource-src-4.8.0.tar.gz",
                unpack archive and take /doc/html/qt.index

                Size of qt.index is ~13.9MB

                1 Reply Last reply
                0
                • V Offline
                  V Offline
                  valerio.j
                  wrote on last edited by
                  #8

                  It works I get the html files with the documentation.
                  How do I add it to Qt Creator help file? there is no .qch file.

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kuzulis
                    Qt Champions 2020
                    wrote on last edited by
                    #9

                    I don't know. Please try search solution in Google :)

                    UPD: I found the decision. It is very simple:

                    1. First, need build documentation as html form (as write above), and to be convinced that into /html directory was generated a SerialPort.qhp file.

                    2. Next, need in console write this:

                    bq. qhelpgenerator html/SerialPort.qhp

                    where qhelpgenerator it is standard Qt tools from /bin directory

                    1. Make sure that into /html directory was generated a SerialPort.qch file.

                    2. Run QtCreator->Options->Help->Add and select SerialPort.qch and click "Apply" buton.

                    It is all...

                    PS: I'm try add this how to to Wiki.

                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      valerio.j
                      wrote on last edited by
                      #10

                      Very good, that works nicely. Yeah it will be a good idea to have all this stuff in the wiki.
                      Thanks for all your help.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved