emental86
29th January 2009, 11:08
Hello,
I need to work with web generated xml document. If I work with local disk file, everithing's fine:
...
QFile file(url);
if(!file.open(QFile::ReadOnly | QFile::Text)) {
cout << "chyba!";
return;
}else{
cout << "soubor otevren...";
read(&file);
}
file.close();
...
You see, I send to method read pointer to file (QIODevice). I want to do something like this:
...
QUrl address = QUrl(url);
if(!address.open(QFile::ReadOnly | QFile::Text)) {
cout << "chyba!";
return;
}else{
cout << "soubor otevren...";
read(&address);
}
...
Of course I know, it's wrong. I found only QDesktopServices::openUrl ( const QUrl & url ) but it opens URL in web browser and I don't want this! I need to work with generated xml file.
It crossed my mind that I can save generated document to disk and then can I work with that like I want to. But I think it's soo complicated.
Thx for any answer...
I need to work with web generated xml document. If I work with local disk file, everithing's fine:
...
QFile file(url);
if(!file.open(QFile::ReadOnly | QFile::Text)) {
cout << "chyba!";
return;
}else{
cout << "soubor otevren...";
read(&file);
}
file.close();
...
You see, I send to method read pointer to file (QIODevice). I want to do something like this:
...
QUrl address = QUrl(url);
if(!address.open(QFile::ReadOnly | QFile::Text)) {
cout << "chyba!";
return;
}else{
cout << "soubor otevren...";
read(&address);
}
...
Of course I know, it's wrong. I found only QDesktopServices::openUrl ( const QUrl & url ) but it opens URL in web browser and I don't want this! I need to work with generated xml file.
It crossed my mind that I can save generated document to disk and then can I work with that like I want to. But I think it's soo complicated.
Thx for any answer...