PDA

View Full Version : Can we attach an interpreter to a plaintextedit in qt??



aaditya190
27th January 2014, 06:43
I have a plaintextedit and I wish to write some C/C++ code in it. Is it possible to link my plaintextedit to an interpreter so that I can get line by line output of the code? I have been able to link it to a compiler but I am unable to get any idea of Interpreter. Can someone help me out??

anda_skoa
27th January 2014, 08:15
You can get access to individual lines, even individual text blocks, through the QTextDocument that you can retrieve from the editor.

Cheers,
_

aaditya190
27th January 2014, 08:19
@anda_skoa, I have been able to retrieve individual lines. The problem I am facing is sending them to an Interpreter or some program which can give me its output.
e.g. If there is a line of C++ code,



cout<<" hello ";


Is there any way to get a particular line's output through an interpreter or any other process? Can you help me out with this??

stampede
27th January 2014, 20:18
C++ is a compiled language (at least it's meant to be). You will have to create an interpreter yourself, or try to use some existing ones, like CINT (http://root.cern.ch/drupal/content/cint). CINT does not support full C++, only a subset of the language (you can find detailed description somewhere on the linked site).

parulkalra14
28th January 2014, 05:35
Can I use CINT interpreter with mingw instead of cygwin on Windows?

ChrisW67
28th January 2014, 07:03
By "use" I assume you mean "build". Maybe, but not trivially.

stampede
28th January 2014, 07:03
I don't know, I used it only on linux. But you can try with mingw and post the results here.

parulkalra14
28th January 2014, 07:50
Can i use Ch Embeddable C/C++ interpreter with qt Applications?

anda_skoa
28th January 2014, 08:43
Can i use Ch Embeddable C/C++ interpreter with qt Applications?
If it has a C or C++ API then very likely.

Cheers,
_

aaditya190
29th January 2014, 10:42
Is it possible to link the cursor of a plaintextedit to an Interpreter?? I wish that the cursor works along with the interpreter. Is it possible to implement so in Qt??

parulkalra14
30th January 2014, 11:35
Can anybody tell me appropriate interpreter which we can use with the qt GUI application and that can also support mingw Compiler?

anda_skoa
30th January 2014, 15:48
Can anybody tell me appropriate interpreter which we can use with the qt GUI application and that can also support mingw Compiler?

Appropriate for what?
How is that in any way related to Qt?

Cheers,
_

parulkalra14
31st January 2014, 05:37
The word appropriate is used with interpreter to know which interpreter supports mingw compiler but any anyways skip this question and move to aadtiya190's Question.
Is it possible to link the cursor of a plaintextedit to an Interpreter?? I wish that the cursor works along with the interpreter. Is it possible to implement so in Qt??

ChrisW67
31st January 2014, 06:19
Any C interpreter written in C++ can be compiled with MingW. All that varies is the amount of work you need to do to port it. There are no free C interpreters I am aware of that come out-of-the-box with a no-brain-required compilation process for MingW.
Embedded Ch claims to build using MingW (http://www.softintegration.com/support/faq/embed.html#Borland_MingW) but it is a commercial product.


Is it possible to link the cursor of a plaintextedit to an Interpreter??
Yes, you can write your program to extract text from your text edit and send it to an interpreter.