c++ - What is the recommended way of passing keyboad events to QProcess transparently? -
I have a GUI application that creates inside QProcess
, captures its output and It shows a specimen. In any way, I need to pass the main events by form to pass them to QProcess
(close to the actual terminals window as close to possible).
So, I suppose, I should process the keyReleaseEvent ()
and in any case either event.text ()
(which QString is
) or event.key ()
(which is int
) for the argument, process.write ()
Suitable for (which is char *
or QByteArray
). Is there a recommended way to do such a conversion (localization problems in the account, ctrl / alt / shift modifiers and so on)? I really do not want to create some sort of mapping of strings from key ()
return values to text ()
modifier returns.
In addition, if I start the process with the command bash -c sudo something
in QPrice, then it immediately comes out, "no TTI is present and No inquiry program specified ", so I am doing something wrong ...
The problem is not more than just deciding to write process.
You can not simulate the terminal by reading / writing a terminal / studin, it is more complex than this. Think about the program low
, or a pager, for example. How does it know how many lines are there to print at one time? It requires information about the terminal which is not displayed through stdin / stdout / stderr.
The simulation of the terminal is beyond the scope of QProcess. If you are actually making sure that you need to do this, then some existing QT-based terminal emulators will be able to access a starting point (such as the console) Use as
Comments
Post a Comment