Click here to Skip to main content
15,506,675 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem creating an array of "class" Pin
Richard MacCutchan9-Sep-22 23:00
mveRichard MacCutchan9-Sep-22 23:00 
GeneralRe: Problem creating an array of "class" Pin
Roberto64_Ge10-Sep-22 1:34
Roberto64_Ge10-Sep-22 1:34 
GeneralRe: Problem creating an array of "class" Pin
Richard MacCutchan10-Sep-22 1:47
mveRichard MacCutchan10-Sep-22 1:47 
QuestionHow can do it in c++? Pin
Member 157580955-Sep-22 7:07
Member 157580955-Sep-22 7:07 
GeneralRe: How can do it in c++? Pin
Richard MacCutchan5-Sep-22 7:43
mveRichard MacCutchan5-Sep-22 7:43 
AnswerRe: How can do it in c++? Pin
Greg Utas5-Sep-22 7:44
mveGreg Utas5-Sep-22 7:44 
QuestionRe: How can do it in c++? Pin
CPallini5-Sep-22 21:50
mveCPallini5-Sep-22 21:50 
QuestionCombining QProcess, qterminal and bluetoothctl...in C++ code Pin
Member 149687714-Sep-22 6:28
Member 149687714-Sep-22 6:28 
SOLVED
thanks to all contributions received from this forum.
Much appreciated.

The att6ached code is being posted here because
it is C++ code
and QT forum did not respond for over two weeks

It is posted to seek a solution, not to receive bunch of social noise.
If you have no knowledge of QT , PLEASE , keep it to yourself ,
no need to advertise it here .

The code
starts QProcess
executes qterminal with -e option thus executing
argument "bluetoothctl"

After many trials, many RTFM and asking Mrs Google


I am unable to pass an optional argument to "bluetoothctl",
for example "help".

I can manually input to the resulting "window", however,
I cannot "write " to it using code.

I suspect that my "write " code is accessing QProcess , not the qterminal...


I am asking for help to solve this... please reply with solutions,

I would greatly appreciate that.





#ifdef TERMINAL_DEBUG
{
qDebug()<< Q_FUNC_INFO;
processTERMINAL = new QProcess();
QString exec = "qterminal";


//params = QStringList() << "qterminal " << command;
//params = QStringList() << "qterminal " << " -e" << " bluetoothctl "; // command;
// no go QStringList params = QStringList() << "qterminal" << "-e" << "bluetoothctl" <<"help\n";
QStringList params = QStringList() << "qterminal" << "-e" << "bluetoothctl" ; // help\n";
processTERMINAL->start(exec, params);
if(processTERMINAL->waitForStarted())
{
qDebug() << " processTERMINAL->waitForStarted() OK";
qDebug() << processTERMINAL->readAllStandardError();
qDebug() << processTERMINAL->readAllStandardOutput();
processTERMINAL->open();
processTERMINAL->write(" help\n");


}
return;
}
#endif

modified 5-Sep-22 13:43pm.

AnswerRe: Combining QProcess, qterminal and bluetoothctl...in C++ code Pin
Mircea Neacsu4-Sep-22 7:05
mvaMircea Neacsu4-Sep-22 7:05 
GeneralRe: Combining QProcess, qterminal and bluetoothctl...in C++ code Pin
Member 149687714-Sep-22 7:38
Member 149687714-Sep-22 7:38 
GeneralRe: Combining QProcess, qterminal and bluetoothctl...in C++ code Pin
Gerry Schmitz4-Sep-22 9:21
mveGerry Schmitz4-Sep-22 9:21 
AnswerRe: Combining QProcess, qterminal and bluetoothctl...in C++ code Pin
Richard MacCutchan4-Sep-22 22:37
mveRichard MacCutchan4-Sep-22 22:37 
Questionforeach - basic C++ question Pin
Member 1496877129-Aug-22 8:23
Member 1496877129-Aug-22 8:23 
AnswerRe: foreach - basic C++ question Pin
Victor Nijegorodov29-Aug-22 8:40
Victor Nijegorodov29-Aug-22 8:40 
AnswerRe: foreach - basic C++ question Pin
Maximilien29-Aug-22 9:23
Maximilien29-Aug-22 9:23 
AnswerRe: foreach - basic C++ question Pin
CPallini29-Aug-22 21:05
mveCPallini29-Aug-22 21:05 
GeneralRe: foreach - basic C++ question Pin
Member 1496877130-Aug-22 4:11
Member 1496877130-Aug-22 4:11 
GeneralRe: foreach - basic C++ question Pin
CPallini30-Aug-22 4:16
mveCPallini30-Aug-22 4:16 
GeneralRe: foreach - basic C++ question Pin
Member 1496877130-Aug-22 5:21
Member 1496877130-Aug-22 5:21 
AnswerRe: foreach - basic C++ question Pin
Richard MacCutchan29-Aug-22 22:56
mveRichard MacCutchan29-Aug-22 22:56 
Questionlinker error lnk2005 Pin
Roberto64_Ge29-Aug-22 5:19
Roberto64_Ge29-Aug-22 5:19 
AnswerRe: linker error lnk2005 Pin
k505429-Aug-22 5:35
mvek505429-Aug-22 5:35 
GeneralRe: linker error lnk2005 Pin
Roberto64_Ge29-Aug-22 6:03
Roberto64_Ge29-Aug-22 6:03 
GeneralRe: linker error lnk2005 Pin
k505429-Aug-22 6:09
mvek505429-Aug-22 6:09 
GeneralRe: linker error lnk2005 Pin
Roberto64_Ge29-Aug-22 6:13
Roberto64_Ge29-Aug-22 6:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.