I have a Qt5/C++ program which receives a QString containing a program name and possibly parameters. I need to split this QString into multiple strings. For example, the strin
I'm not familiar with the particulars of Qt, however with a quick look at the documentation for QString, here, I believe that the following code should work (albeit inefficiently).
#include
#include
vector list; //vector used for variable length parameter requirements
QString args; //The arguments string
bool quoteFlag = false;
for(int i=0; i
Again, I do not use any Qt libraries, and this code is untested, but, if I understand the documentation, it should work.
As far as the -p 4
bit goes, that is not possible with your current syntax for the other arguments.