I'm currently trying to make a Qt console program work with ncurses. I would like to enjoy the advantages of ncurses while still being able to use QTextStream for input and output.
The idea is to use while((c = getch()).....
for one particular type of input, while using QTextStream(stdin)
for other types of input.
The thing is, if I proceed as follows:
initscr();
//do ncurses stuff
//do QTextStream(stdout) stuff
//do QTextStream(stdin) stuff
However, if I do this:
initscr();
//do ncurses stuff
endwin();
//do QTextStream(stdout) stuff
//do QTextStream(stdin) stuff
The result looks much more appropriate:
My question is if the same result can be achieved without the repeated calling of initscr();
and endwin();
every time I want to receive a specific type of input (this is dome relatively often in the program). And if not, are there any pitfalls to this? I know it definitely is not a decent programming practice, but can it have consequences beyond that? The effect on performance is not noticable, at least.