![]() |
Здравствуйте, гость ( Вход | Регистрация )
![]() |
borune |
![]()
Сообщение
#1
|
Участник ![]() ![]() Группа: Участник Сообщений: 152 Регистрация: 1.1.2011 Пользователь №: 2314 Спасибо сказали: 0 раз(а) Репутация: ![]() ![]() ![]() |
Добрый день, камрады,
возник такой вопрос - нужно в программе реализовать вызов терминала xterm, выполнить в нем некоторую команду, затем закрыть терминал, а вывод из терминала обработать потом в программе. Как такое делается, подскажите пожалуйста. |
|
|
![]() |
Алексей1153 |
![]()
Сообщение
#2
|
![]() фрилансер ![]() ![]() ![]() ![]() ![]() ![]() Группа: Участник Сообщений: 2941 Регистрация: 19.6.2010 Из: Обливион Пользователь №: 1822 Спасибо сказали: 215 раз(а) Репутация: ![]() ![]() ![]() |
borune,
если открыть справку по классу, то там можно найти следующее ))) Цитата void QProcess::setArguments(const QStringList & arguments) Set the arguments to pass to the called program when starting the process. That function must be call before open() Цитата void QProcess::start(const QString & program, const QStringList & arguments, OpenMode mode = ReadWrite) Starts the given program in a new process, if none is already running, passing the command line arguments in arguments. The OpenMode is set to mode. The QProcess object will immediately enter the Starting state. If the process starts successfully, QProcess will emit started(); otherwise, error() will be emitted. If the QProcess object is already running a process, a warning may be printed at the console, and the existing process will continue running. Note: Processes are started asynchronously, which means the started() and error() signals may be delayed. Call waitForStarted() to make sure the process has started (or has failed to start) and those signals have been emitted. Note: No further splitting of the arguments is performed. Windows: Arguments that contain spaces are wrapped in quotes. >>А как имитировать нажатие энтера по окончании ввода? это не знаю, разве что попробовать писать в поток процесса. Я это не делал, надо разбираться Сообщение отредактировал Алексей1153 - 3.6.2014, 8:35 |
|
|
![]() ![]() ![]() |
![]() |
|
Текстовая версия | Сейчас: 18.2.2025, 22:04 |