Why don't you just try it?
Selecting a network file with a File-Open-Dialog and then reading it with QFile, doesn't require any special treatment.
Windows handles SMB shares transparently.
#include <QtCore>
#include <QtGui>
int main(int argc, char *argv[])
{
QPlainTextEdit te;
te.show();
QString fileName
= QFileDialog::getOpenFileName(0,
"Open Text File",
"",
"Text Files (*.txt *.*)");
qDebug() << fileName;
{
te.setPlainText(ts->readAll());
delete ts;
}
delete f;
QObject::connect(&a,
SIGNAL(lastWindowClosed
()),
&a,
SLOT(quit
()));
return a.exec();
}
#include <QtCore>
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPlainTextEdit te;
te.show();
QString fileName = QFileDialog::getOpenFileName(0, "Open Text File", "", "Text Files (*.txt *.*)");
qDebug() << fileName;
QFile* f = new QFile(fileName);
if (f->open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream* ts = new QTextStream(f);
te.setPlainText(ts->readAll());
delete ts;
}
delete f;
QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Debug Output:
"//JOHANNES-PC/Musik/Mexp Key.txt"
HIH
Johannes
Bookmarks