user1899020
user1899020

Reputation: 13575

How to use Qt to build a command window?

I totally have no idea. Any suggestion on it? It is a command window accepting some commands like:

> Add(1, 2)

and other similars.

Upvotes: 0

Views: 79

Answers (1)

pippin1289
pippin1289

Reputation: 4939

This is a very vague question. Since there is no built-in parser generation in Qt, you can combine boost or YACC to get parsing. Use a QInputDialog or a QTextEdit from Qt for input and display. Basically set up some events in Qt for the parsing.

Have a class extending QInputDialog storing a string cmd. This class has a parsing function which will call the right code from the entered command or report an error. Then store a set of completed commands or outputs which you display back to the user. For exact code, you need to try something, and look at some tutorials, and ask more SO questions :)

Hope this is an ok start to get your mind going.

Upvotes: 2

Related Questions