passing multiple options to qterminal
-
wrote on 19 Sept 2022, 14:10 last edited by
Could somebody please verify my code ?
I am trying to instruct qterminal to execute "bluetoothctl help".
I cannot get expected result , actually no results at all.
And no errors either.Reading qterminal manual does no tell how to pass "options" to the command , hence I may be
coding something which cannot be done by qterminal.Thanks
processTERMINAL = new QProcess(); QString exec = "qterminal"; QStringList params;
this works as expected
/ params = QStringList()<<"-e"<<"bluetoothctl";this does not
params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << "help";qDebug() <<"params " << params;
// processTERMINAL->start(exec,QStringList()<<arguments);
processTERMINAL->start(exec,params); if(processTERMINAL->waitForStarted())
-
Could somebody please verify my code ?
I am trying to instruct qterminal to execute "bluetoothctl help".
I cannot get expected result , actually no results at all.
And no errors either.Reading qterminal manual does no tell how to pass "options" to the command , hence I may be
coding something which cannot be done by qterminal.Thanks
processTERMINAL = new QProcess(); QString exec = "qterminal"; QStringList params;
this works as expected
/ params = QStringList()<<"-e"<<"bluetoothctl";this does not
params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << "help";qDebug() <<"params " << params;
// processTERMINAL->start(exec,QStringList()<<arguments);
processTERMINAL->start(exec,params); if(processTERMINAL->waitForStarted())
wrote on 19 Sept 2022, 14:13 last edited by JonB@AnneRanch
I am trying to instruct qterminal to execute "bluetoothctl help".
Presumably you want
params = QStringList()<<"-e"<<"bluetoothctl help";
-
@AnneRanch
I am trying to instruct qterminal to execute "bluetoothctl help".
Presumably you want
params = QStringList()<<"-e"<<"bluetoothctl help";
wrote on 19 Sept 2022, 16:17 last edited by@JonB Yes, your assumption is correct ...and it does not work ,,,been there , done that
-
@JonB Yes, your assumption is correct ...and it does not work ,,,been there , done that
wrote on 19 Sept 2022, 16:50 last edited by@AnneRanch
Guessing from https://github.com/lxqt/qterminal/blob/master/src/main.cpp, eitherparams = QStringList()<<"-e"<<"bluetoothctl help"; params = QStringList()<<"-e"<<"bluetoothctl" << "help";
may work just as well, because the author likes the latter. So long as you have tried both those it's not your command-line that is at issue.
-
@AnneRanch
Guessing from https://github.com/lxqt/qterminal/blob/master/src/main.cpp, eitherparams = QStringList()<<"-e"<<"bluetoothctl help"; params = QStringList()<<"-e"<<"bluetoothctl" << "help";
may work just as well, because the author likes the latter. So long as you have tried both those it's not your command-line that is at issue.
wrote on 19 Sept 2022, 17:56 last edited by@JonB said in passing multiple options to qterminal:
params = QStringList()<<"-e"<<"bluetoothctl help";
params = QStringList()<<"-e"<<"bluetoothctl" << "help";These are all of my attempts to make it work...
What is really frustrating - there are no progress / error codes -
the QProcess starts but there is obviously no execution of the arguments...params = QStringList()<<"-e"<<"bluetoothctl"; //params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << " help"; //params = QStringList()<<"-e"<<"bluetoothctl help"; //params = QStringList()<<"-e"<<"bluetoothctl" << "help";
I did post my inquiry in "qterminal" forum - waiting for reply....
Irregardless if I can make it work - I am still working on how to actually access the "window "
created . Again - most people expect to have single process question and this is not
a single issue - it has to be solved as a collection of systems / processes etc.And I am reluctant to post in half a dozed forums just to solve ONE process.
. -
wrote on 19 Sept 2022, 19:12 last edited by mchinand
Does it work when just calling it from the command line?
qterminal -e bluetoothctl help
-
@JonB said in passing multiple options to qterminal:
params = QStringList()<<"-e"<<"bluetoothctl help";
params = QStringList()<<"-e"<<"bluetoothctl" << "help";These are all of my attempts to make it work...
What is really frustrating - there are no progress / error codes -
the QProcess starts but there is obviously no execution of the arguments...params = QStringList()<<"-e"<<"bluetoothctl"; //params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << " help"; //params = QStringList()<<"-e"<<"bluetoothctl help"; //params = QStringList()<<"-e"<<"bluetoothctl" << "help";
I did post my inquiry in "qterminal" forum - waiting for reply....
Irregardless if I can make it work - I am still working on how to actually access the "window "
created . Again - most people expect to have single process question and this is not
a single issue - it has to be solved as a collection of systems / processes etc.And I am reluctant to post in half a dozed forums just to solve ONE process.
.wrote on 19 Sept 2022, 19:14 last edited by@AnneRanch
Ultimately if you get it going it will behave the same as your xterm attempt, because you are still running a terminal. -
wrote on 19 Sept 2022, 23:54 last edited by Anonymous_Banned275
No, it does not work from terminal, hence the problem is in qterminal itself. I think it is time to abandon qterminal....
-
@AnneRanch
Ultimately if you get it going it will behave the same as your xterm attempt, because you are still running a terminal.wrote on 20 Sept 2022, 00:03 last edited by@JonB
I fully realize that - but this "native window" exists physically and I should be able to access it.
As I said - this is not a single process problem - now the multiple options is identified - it is time to
concentrate on access to "NATIVE WINDOW"... -
No, it does not work from terminal, hence the problem is in qterminal itself. I think it is time to abandon qterminal....
wrote on 20 Sept 2022, 00:39 last edited by@AnneRanch said in passing multiple options to qterminal:
No, it does not work from terminal
Is that 'Shell No. 1' terminal the result of
qterminal -e bluetoothctl
? Doesn't that mean it does work from a terminal? -
@AnneRanch said in passing multiple options to qterminal:
No, it does not work from terminal
Is that 'Shell No. 1' terminal the result of
qterminal -e bluetoothctl
? Doesn't that mean it does work from a terminal?wrote on 20 Sept 2022, 01:11 last edited by@mchinand Please read the title and the last post - it about passing multiple options .....and that does not work
-
@JonB
I fully realize that - but this "native window" exists physically and I should be able to access it.
As I said - this is not a single process problem - now the multiple options is identified - it is time to
concentrate on access to "NATIVE WINDOW"...wrote on 20 Sept 2022, 07:16 last edited by JonB@AnneRanch said in passing multiple options to qterminal:
but this "native window" exists physically and I should be able to access it.
it is time to concentrate on access to "NATIVE WINDOW"...I have tried to explain several times that you will not be able to access the output you see in a terminal --- whether from xterm or qterminal --- from an external program, such as your Qt application. That output goes into the terminal's output window and is not available to "see" or "read" elsewhere, even though you would like it to be. But I will leave you to your investigations.
When you come to the same conclusion you have my reply at https://forum.qt.io/topic/139374/another-xterm-qtextedit-issues/10 which shows what you will need to do if you do wish to access the output from
bluetoothctl
and has code showing how to do it and what the final output will look like.
1/12