Click here to Skip to main content
15,441,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Remove white space - empty lines - in editor Pin
Dave Kreskowiak16-Aug-22 3:47
mveDave Kreskowiak16-Aug-22 3:47 
GeneralRe: Remove white space - empty lines - in editor Pin
Richard MacCutchan16-Aug-22 3:54
mveRichard MacCutchan16-Aug-22 3:54 
GeneralRe: Remove white space - empty lines - in editor Pin
Dave Kreskowiak16-Aug-22 4:21
mveDave Kreskowiak16-Aug-22 4:21 
GeneralRe: Remove white space - empty lines - in editor Pin
PIEBALDconsult17-Aug-22 8:26
professionalPIEBALDconsult17-Aug-22 8:26 
AnswerRe: Remove white space - empty lines - in editor Pin
trønderen15-Aug-22 11:53
Membertrønderen15-Aug-22 11:53 
GeneralRe: Remove white space - empty lines - in editor Pin
DerekT-P16-Aug-22 23:19
professionalDerekT-P16-Aug-22 23:19 
GeneralRe: Remove white space - empty lines - in editor Pin
Richard MacCutchan17-Aug-22 0:18
mveRichard MacCutchan17-Aug-22 0:18 
Questionhow to resolve and understand how / why it works or not Pin
Member 1496877112-Aug-22 12:28
MemberMember 1496877112-Aug-22 12:28 
Please understand that I am asking here and it is NOT a Qt question.
My task is to start a new process - the parameters are "application" and its parameters.
The basic process builds a "Database" and I am not so sure about "bin/sh" - I guess it "runs" a shell...
It works and there is no need to get into why at this point.

The "problem" is - the "process" is running and I need to interact with it.
I can use "write" but I have no idea when and where and how.

In the enclosed snippet the "info\n" is "send" to the file ( shell?) before it is finished...

I do understand that Qt process can "wait for finished " and I can also get a SIGNAL when the file is actually done building. What I do not get - if the process is actually /physically building / writing a file - what does "wait for finished " waiting for ?

Again - I am not asking how to code Qt , I am asking how to code so I can "write" the additional stuff in right time.


C++
std::string Database  = BT_DATABASE_TEST;
           std::string Command   = "bluetoothctl ";
           std::string command = Command + std::string(" | tee ") + Database  + std::string(" | tee /tmp/temp");
           QP->start("/bin/sh", QStringList() << "-c" << command.c_str());

           qDebug()<< "TEST QProcess CONTINUE DEBUG point  @line " << QString::number(__LINE__);
           QP->waitForFinished();
           QP->write("info\n");   writes too soon
           qDebug() << QP->readAllStandardError();
           qDebug() << QP->readAllStandardOutput();

AnswerRe: how to resolve and understand how / why it works or not Pin
Richard MacCutchan12-Aug-22 22:12
mveRichard MacCutchan12-Aug-22 22:12 
GeneralRe: how to resolve and understand how / why it works or not Pin
Member 1496877113-Aug-22 4:09
MemberMember 1496877113-Aug-22 4:09 
GeneralRe: how to resolve and understand how / why it works or not Pin
Richard MacCutchan13-Aug-22 4:28
mveRichard MacCutchan13-Aug-22 4:28 
GeneralRe: how to resolve and understand how / why it works or not Pin
Member 1496877113-Aug-22 6:12
MemberMember 1496877113-Aug-22 6:12 
GeneralRe: how to resolve and understand how / why it works or not Pin
Richard MacCutchan13-Aug-22 6:25
mveRichard MacCutchan13-Aug-22 6:25 
GeneralRe: how to resolve and understand how / why it works or not Pin
Member 1496877113-Aug-22 8:59
MemberMember 1496877113-Aug-22 8:59 
Question#define won't work in QStringList , gives no error Pin
Member 1496877111-Aug-22 11:18
MemberMember 1496877111-Aug-22 11:18 
AnswerRe: #define won't work in QStringList , gives no error Pin
Mircea Neacsu11-Aug-22 11:57
mvaMircea Neacsu11-Aug-22 11:57 
GeneralRe: #define won't work in QStringList , gives no error Pin
Member 1496877111-Aug-22 16:43
MemberMember 1496877111-Aug-22 16:43 
GeneralRe: #define won't work in QStringList , gives no error Pin
David Crow11-Aug-22 16:03
MemberDavid Crow11-Aug-22 16:03 
Questionmanaging objects derived from the same base class using a container Pin
Calin Cali10-Aug-22 3:29
MemberCalin Cali10-Aug-22 3:29 
AnswerRe: managing objects derived from the same base class using a container Pin
Mircea Neacsu10-Aug-22 3:55
mvaMircea Neacsu10-Aug-22 3:55 
AnswerRe: managing objects derived from the same base class using a container Pin
Greg Utas10-Aug-22 3:56
mveGreg Utas10-Aug-22 3:56 
GeneralRe: managing objects derived from the same base class using a container Pin
Calin Cali10-Aug-22 6:34
MemberCalin Cali10-Aug-22 6:34 
AnswerRe: managing objects derived from the same base class using a container Pin
Richard MacCutchan10-Aug-22 4:01
mveRichard MacCutchan10-Aug-22 4:01 
GeneralRe: managing objects derived from the same base class using a container Pin
Calin Cali10-Aug-22 6:33
MemberCalin Cali10-Aug-22 6:33 
GeneralRe: managing objects derived from the same base class using a container Pin
Richard MacCutchan10-Aug-22 6:40
mveRichard MacCutchan10-Aug-22 6:40 

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.