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. Interfacing existing C++ console application with GUI in Qt.
Forum Updated to NodeBB v4.3 + New Features

Interfacing existing C++ console application with GUI in Qt.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 4.4k 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.
  • B Offline
    B Offline
    BlackPhoenix
    wrote on 30 May 2013, 19:53 last edited by
    #1

    Hello everyone. Learning basic programming in C/C++. So far only simple console applications, mostly with Code Blocks. Now I have made a console application (parcel/package mangement system), to which I want to add a GUI, so I am giving Qt a try.
    The program is complete in console form. Now I just want to add simple GUI, so that when a certain button is pressed an object is created, or its function is executed. However it seems many things have to change. For example, before this I took input for different fields (name, address etc of one person) separately and put them in separate strings and wrote them to a file. Now I want the user to give the input into different fields in a window and click Ok, which will put all that information into the strings and write them to the intended file.
    So I just want some pointers to get started. How do I do the above mentioned tasks? Do I have to re-write the input functions for the signal slot mechanism? How do I associate each field with a string associated to an object so that something input into a textbox goes to that string when Ok is clicked? The standard C++ libraries (iostream, fstream, string.h, sstream etc don't work when the project type is Qt GUI application), so which project type should I choose for the intended purpose?

    Will be thankful for answers.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 May 2013, 20:52 last edited by
      #2

      Hi and welcome to devnet,

      You should have a look at the examples and demos provided with the Qt documentation, they cover all the areas your are interested in.

      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
      • J Offline
        J Offline
        Jeroentjehome
        wrote on 31 May 2013, 12:24 last edited by
        #3

        The Qt GUI application supports iostream etc. You just need to include the namespace for it. Since the situation that you give isn't a code example we can't really help you out here. Like SGaist says, just read the docs and you figure it out. Otherwise give us a piece of code to interface with. What kind of C++ class/object do you use/create etc. Now it's just guessing for us what you need.
        People are happy to help on this forum, so give us something to help you with.
        Greetz

        Greetz, Jeroen

        1 Reply Last reply
        0

        1/3

        30 May 2013, 19:53

        • Login

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