Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I`m in need of creating ui for a program written in c++. As I am a total newbie in Qt I need some help. The original program is quite long so I will just describe what I need. Program in console version just asks user for a row of numeric data and calculates solution. I have designed a UI in Qt [1]: http://i.stack.imgur.com/Hox2u.jpg and and I want to use my old program as a function in which input data are gathered from UI and then start button launches calculation and returns the solution.
To make it easy how to connect for example an easy function (c * b+c) where inputs are values gathered from comboboxes and sliders made in design mode and how to launch that function by button and return the solution?
Very rough guess, but I believe you want to reuse your previous code without copy pasting the new UI code .
For that you should use static or dynamic linkage. Set your old program to be compiled as a library and link it to your project.
Find tutorials online on how to do that.
Search for static linkage, dynamic linkage, dynamic loading and shared libraries.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am new to the GUI development environment. I found qt to be interesting as it is a huge framework but it requires its program to be coded in C++. I want to create a small windowed GUI program which could have transitions etc. provided by QML. What are the possible ways to compile it along with existing C code with or without qt creator ?
As long as you pay attention to linkage (C functions should use C linkage), there will be no problems: a C library can safely be used in a C++ program.
For what concerns implementing your GUI with QML, start by taking a look at the Qt QML examples and work your way from there.
QML is mostly used for mobile UI render (i.e. when there's no native support openGL kicks in and renders the element via the available driver), anyway it can play along just fine on any Qt-supported platform.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Let's say we've got a first program called Program1.exe which contains the necessary information to create and compile another application called Program2.exe. Actually it could also load that information from a txt file or whatever.
Googling, I've found that this is "easy" to do in C#, using Visual Studio:
How to programatically build and compile another c# project from the current project
Programmatically Invoke the C# Compiler
The problem is that I'm not using (and can't use) C#, but C++. Summing it up, my question is if that I can do this same thing using C++.
I would prefer to do it without additional libraries, but if that's not possible, or if it's too hard to do, you can also recommend any library allowing it.
I think you'll probably have noticed it, but my goal is to use it under Windows so I don't care if it's not portable.
Thanks everybody.
It's trivial (if maybe a bit odd) for a C++ program to compile and run another based on code stored in a text file. Debugging that other program, however, isn't.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to explore about the signal of buttons from my gamepad, it's old but can use. And i want to code a small program that can detect and display the 'code' of these buttons when I touch to them in C++, can any body help me, I don't know where can I start ? Please !!!
To put it shortly, if you want to make a game playable in the command line, then don't. It's not meant for that kind of purpose.
I would personally suggest the SFML library. It has utilities for drawing on a window, handling events, graphics, sound, etc. and it's also pretty simple. Here is what you are (probably) looking for:
sf::Joystick class
However, if you don't want to use any external library, you will have to rely on your OS's library (e.g windows.h on windows) but that would make the code non portable, and most people hate that, since C/C++ were created specifically for that purpose. So this method is generally not suggested.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am a beginner at programming, so this might be a dumb question, but here it is...
I've been going through books, learning languages such as C and C++, and I have a basic understanding of the code. Yet, is this type of code used in actual programs? For example, I open a program on my computer, and there is a nice looking user interface on it. When I code programs at home, my user interface is the command line. But when I go to code a program with a GUI, the code I learn in books doesn't even apply to the GUI code.
So I guess I'm wondering - How does the code and things you learn in books apply to actual programs with a user interface? And is the code used for console applications even used anymore?
Any guidance or help would be appreciated!
Thanks
Ian Vaughn
Yes and yes.
GUI's are sometimes programmed in C++ (C is rarer), but it's also used for console programs. One special type of GUI's is in fact usually done in C++, and that's games. A common example of console programs is a converter program, which takes in one file and creates another. It's UI can be ./tool < InFile > OutFile.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am given a task to develop an C++ command-line(terminal, I am using, will run the program in Linux/Ubuntu) display. But I dont like the command-line design, is there anyway to improve the UI design?
Note: I must run the program in terminal!!
ncurses. It's a lib to be able to put text wherever you want in the terminal, so you can effectively draw, ascii-art style in the terminal. It's also a very old library, so it may be a little tedious to use.
I developed a simple multiplatform console management library some time ago.
You can use it at least on Linux and Windows. It uses native calls in Windows, and standard escape codes in other platforms.
If you just want to show some colors, position the cursor, and so on, you can use it in a matter of minutes without struggling with ncurses.
The documentation (generated with doxygen) is included in the Zip file.