本文整理汇总了C++中QFile::symLinkTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ QFile::symLinkTarget方法的具体用法?C++ QFile::symLinkTarget怎么用?C++ QFile::symLinkTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFile
的用法示例。
在下文中一共展示了QFile::symLinkTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onOpenFileButton
void Widget::onOpenFileButton()
{
QTextStream qout(stdout);
QTextStream qin(stdin);
QString filename;
qout << "Open file button" << endl;
qout << "Filename: " << flush;
//filename = qin.readLine();
filename = QFileDialog::getOpenFileName(this,
tr("Open SolTrace input file"), "", tr("SolTrace files (*.stinput);;All files (*.*)"));
qout << "The filename was " << filename << endl;
if (QFile::exists(filename)) {
qout << "The file exists." << endl;
QFile *file = new QFile(filename);
qout << "Is a link to: " << file->symLinkTarget() << endl;
if (file->open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream ts(file);
ST_document *doc = new ST_document(file, ts);
file->close();
myDocModel->setDoc(doc);
ui->treeView->setModel(myDocModel);
ui->treeView->reset();
ui->tableView->setModel(new ST_sun_model(doc));
} else {
qout << "Can't do it." << endl;
}
} else {
qout << "Open file failed: no such file: " << filename << endl;
}
}