Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Beginner in need of guidance

Beginner in need of guidance

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 211 Views
  • 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.
  • M Offline
    M Offline
    Mike105105
    wrote on last edited by
    #1

    Hi all. I'm mainly a C programmer with some C++ as well. I need guidance with integrating QT into my applications. I have an application that polls a data file and populates an internal data structure(array of opjects), and sends any changes that are found between consecutive pollings out the serial port(it also does some other stuff behind the scenes). How do I even begin adding an interface to visualize and possibly change data in that internal data structure? I didn't decide on adding a gui till the application was completed and I don't really want to rewrite from scratch. I have never used QT before so I'm a little lost. Any advice would be greatly appreciated.

    Thanks,
    Michael

    raven-worxR 1 Reply Last reply
    0
    • M Mike105105

      Hi all. I'm mainly a C programmer with some C++ as well. I need guidance with integrating QT into my applications. I have an application that polls a data file and populates an internal data structure(array of opjects), and sends any changes that are found between consecutive pollings out the serial port(it also does some other stuff behind the scenes). How do I even begin adding an interface to visualize and possibly change data in that internal data structure? I didn't decide on adding a gui till the application was completed and I don't really want to rewrite from scratch. I have never used QT before so I'm a little lost. Any advice would be greatly appreciated.

      Thanks,
      Michael

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Mike105105
      you may want to start with a QSerialPort example.
      File access is handled with QFile. You internal data structure can be anything you like.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Beside the good advice from @raven-worx, how did you implement your file polling ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mike105105
          wrote on last edited by Mike105105
          #4

          I have a thread that periodically locks the json file and reads it in with fopen and fread. The data buffer gets decoded using json-c and entered into the data structure. The objects in the data structure keep tabs on whether the data given to them has changed since the last update. Another thread periodically increments through the array of objects and triggers their send update function and if that object has registered a change it transmits out the serial port. The application also writes a json file out with information on the systems network status like IP address. There is also a system config file that gets read to set up which serial port and a few other things.

          I just wish I had thought about a local gui when I started writing everything.

          Thanks,
          Michael

          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