Thread: Design. Good approach for Implementing GUI on existing CLI program.

  1. #1
    Registered User
    Join Date
    Sep 2020
    Posts
    10

    Design. Good approach for Implementing GUI on existing CLI program.

    I wrote a simple text manipulation program in C, on my Linux machine and crosscompiled it for my Windows target audience using MingW64. To make it more accessible I want to create a simple GUI for it using Qt.

    I settled on Qt because it is portable, well supported, has great documentation, I'm already using it (KDE) and will serve me as an excuse to start learning C++.

    I was wondering what would be the best way to integrate the GUI into my existing program. Should I change my program into a library and link it into the GUI. Should I keep the CLI part? I'd like to but how difficult would it be to integrate.

    I'm thinking the easiest way, specially considering the crosscompilation (I'm assuming Qt has a very complicated, unique way to do this) would be to compile my existing program as a library, exposing only certain general functions to communicate with the GUI which would collect and validate input, and produce feedback. I can simply gather input on the GUI code, pass it to a "collector" function that will populate my program's structures and validate the input.

    This would be a very runabout way to do it though, and I'd be wasting opportunities to take advantage of the GUI to streamline my code.
    Last edited by Exosomes; 09-20-2020 at 04:47 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 09-15-2013, 02:15 PM
  2. How good Design a program
    By nima0102 in forum C Programming
    Replies: 4
    Last Post: 04-01-2012, 01:10 AM
  3. Server<T> good approach?
    By idleman in forum Networking/Device Communication
    Replies: 0
    Last Post: 07-18-2009, 06:41 AM
  4. is such exception handling approach good?
    By George2 in forum C++ Programming
    Replies: 8
    Last Post: 12-27-2007, 08:54 AM
  5. Unicode & Good Program Design :: C++
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 08-05-2002, 04:09 PM

Tags for this Thread