I want to make an URL with some parts extracted from a text file.
I have the following code:
crack_order = new QFile("orders.txt"); //I have QFile *crack_order in headers
crack_order->open(QIODevice::ReadOnly);
while(!crack_order->atEnd()){
QStringList orders;
orders = QString(crack_order->readAll()).split('\n',QString::SkipEmptyParts);
foreach (QString order, orders){
ui->debugtextbox->setText(order); //until here, it works fine!
url = "http://www.example.com/customers/orders/"+order+"/another/thing.txt";
It does not work, the URL request isn't performed correctly. However, if I put the following variable:
QString order = "12233";
before url
, it works!
Then, I guess the problem is that it's getting the "order" from a text file, and QUrl doesn't like it.
Any idea?