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. Doubts about using serial ports and how to plot 2d graphics
Qt 6.11 is out! See what's new in the release blog

Doubts about using serial ports and how to plot 2d graphics

Scheduled Pinned Locked Moved 3rd Party Software
2 Posts 2 Posters 4.1k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Goodnight, I'm getting started about using Qt and I need/want to have acess to data that comes from a serial port, and as far as I have found Qt doesnt support serial ports nativelly, so I found QSerialDevice and QextSerialPort and I have some doubts about them.
    First is, do I compile and put the compiled files in some library folder of the Qt Creator or I just copy all the code when I need to use it?
    The other is, if there are two different implementations, what is the best one?

    Then there is my another doubt, how can I for example receive an 128x128 pixels gray-scale image and then plot it into the user interface window? The doubt is really if there are Qt functions to help plotting 2d data into a specific graph area.

    Thanks in advance for all the help.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      I have used QextSerialPort for many years and am very happy with it. Usually one would build it as a shared library and link your own applications and libraries to it in the usual way (ie edit the LIBS variable in your .pro file).

      As for your second question, how you receive the data back is entirely dependent upon what protocol your serial device is using layered on top of the standard RS232 comms protocol. A library like QextSerialPort and the OS take care of the RS232 part but you are responsible for anything above that.

      If you can get the bytes of your 128x128 greyscale image then you can create a QImage from them (see the many QImage constructors). You can then use a QLabel (or your own custom widget and QPainter) to show the image.

      HTH

      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