Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Running C code from QT
Forum Updated to NodeBB v4.3 + New Features

Running C code from QT

Scheduled Pinned Locked Moved Language Bindings
3 Posts 2 Posters 1.6k 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.
  • R Offline
    R Offline
    Ramon
    wrote on last edited by
    #1

    Hi,
    I have written a C program for curve fitting which I compile on Linux by running 'g++ curve_fitting.c -o fit'. It can be executed by running './fit' in terminal.
    When run, it asks for two inputs (numerical values) from the user via terminal and displays the final output- again through terminal.

    My requirement is to link this code (curve_fitting.c) to QT GUI so that the user will be presented with two boxes where he enters the two inputs. Then the C code should run and display the final output on the GUI. In a sense I want to replace Linux terminal with GUI. Can you guide me please?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      You can rename your file into .cpp and include it as a part of a Qt project and then call the function from a widget.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Ramon
        wrote on last edited by
        #3

        Sorry for the long delay in responding. I had totally forgotten creating this thread until two days back.

        Gave it a try as you suggested and succeeded with minor hiccups. Thank you. :)

        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