Results 1 to 14 of 14

Thread: Can we attach an interpreter to a plaintextedit in qt??

  1. #1
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Can we attach an interpreter to a plaintextedit in qt??

    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??

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Merry Christmas friends !

    You can get access to individual lines, even individual text blocks, through the QTextDocument that you can retrieve from the editor.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Can we attach an interpreter to a plaintextedit in qt??

    @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??

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Can we attach an interpreter to a plaintextedit in qt??

    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. CINT does not support full C++, only a subset of the language (you can find detailed description somewhere on the linked site).

  5. #5
    Join Date
    Nov 2013
    Posts
    46
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Can we attach an interpreter to a plaintextedit in qt??

    Can I use CINT interpreter with mingw instead of cygwin on Windows?
    Last edited by parulkalra14; 28th January 2014 at 05:44.

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Can we attach an interpreter to a plaintextedit in qt??

    By "use" I assume you mean "build". Maybe, but not trivially.

  7. #7
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Can we attach an interpreter to a plaintextedit in qt??

    I don't know, I used it only on linux. But you can try with mingw and post the results here.

  8. #8
    Join Date
    Nov 2013
    Posts
    46
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Can we attach an interpreter to a plaintextedit in qt??

    Can i use Ch Embeddable C/C++ interpreter with qt Applications?

  9. #9
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Can we attach an interpreter to a plaintextedit in qt??

    Quote Originally Posted by parulkalra14 View Post
    Can i use Ch Embeddable C/C++ interpreter with qt Applications?
    If it has a C or C++ API then very likely.

    Cheers,
    _

  10. #10
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Linking QTextCursorof a plaintextedit to an Interpreter

    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??

  11. #11
    Join Date
    Nov 2013
    Posts
    46
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Linking QTextCursorof a plaintextedit to an Interpreter

    Can anybody tell me appropriate interpreter which we can use with the qt GUI application and that can also support mingw Compiler?

  12. #12
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Linking QTextCursorof a plaintextedit to an Interpreter

    Quote Originally Posted by parulkalra14 View Post
    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,
    _

  13. #13
    Join Date
    Nov 2013
    Posts
    46
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Linking QTextCursorof a plaintextedit to an Interpreter

    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??

  14. #14
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Linking QTextCursorof a plaintextedit to an Interpreter

    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 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.

Similar Threads

  1. Linking a plaintextedit to the gcc compiler
    By aaditya190 in forum Qt Programming
    Replies: 3
    Last Post: 13th January 2014, 09:38
  2. Line numbering of a plaintextedit
    By aaditya190 in forum Newbie
    Replies: 5
    Last Post: 10th December 2013, 05:44
  3. qt cross compilation error "unable to load interpreter"
    By cpalm in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 12th July 2011, 10:51
  4. Block the plainTextEdit
    By NewLegend in forum Newbie
    Replies: 6
    Last Post: 16th September 2010, 14:56
  5. BFRunner - Brainfuck Interpreter
    By hazardpeter in forum Qt-based Software
    Replies: 0
    Last Post: 29th November 2009, 12:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.