Qt4 如何使用本机SDK访问blackberry 10上的文本文件
在一个名为Resources的文件夹中,我有一个名为“hello.txt”的文本文件。如何使用blackberry 10原生sdk和cpp阅读它。 我发现了一些类似于使用文件连接的东西。但是它的显示文件连接没有声明!!。是否需要任何头文件?? 请注意,我正在使用cpp:Qt4 如何使用本机SDK访问blackberry 10上的文本文件,qt4,filesystems,blackberry-10,qfile,Qt4,Filesystems,Blackberry 10,Qfile,在一个名为Resources的文件夹中,我有一个名为“hello.txt”的文本文件。如何使用blackberry 10原生sdk和cpp阅读它。 我发现了一些类似于使用文件连接的东西。但是它的显示文件连接没有声明!!。是否需要任何头文件?? 请注意,我正在使用cpp: FileConnection fc = (FileConnection) Connector.open("Resources/hello.txt", Connector.READ); 如何执行此操作?使用QFile和QText
FileConnection fc = (FileConnection) Connector.open("Resources/hello.txt", Connector.READ);
如何执行此操作?使用QFile和QTextStream类读取或写入文件
QFile file("app/native/assets/text.txt");
if (file.exists()) {
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream textStream(&file);
QString text = textStream.readAll();
file.close();
}
} else {
qDebug() << "File doesn't exist";
}
QFile文件(“app/native/assets/text.txt”);
if(file.exists()){
if(file.open(QIODevice::ReadOnly | QIODevice::Text)){
QTextStream textStream(&file);
QString text=textStream.readAll();
file.close();
}
}否则{
qDebug()使用QFile和QTextStream类读取或写入文件
QFile file("app/native/assets/text.txt");
if (file.exists()) {
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream textStream(&file);
QString text = textStream.readAll();
file.close();
}
} else {
qDebug() << "File doesn't exist";
}
QFile文件(“app/native/assets/text.txt”);
if(file.exists()){
if(file.open(QIODevice::ReadOnly | QIODevice::Text)){
QTextStream textStream(&file);
QString text=textStream.readAll();
file.close();
}
}否则{
qDebug()您是否从BlackBerry JDE API或BB 10 API之一获取了文件连接?在搜索BB 10本机API文档时,它不会出现,我怀疑您正在阅读JDE文档。您是否从BlackBerry JDE API或BB 10 API之一获取了文件连接?在搜索BB 10本机API文档时,它不会出现s、 我怀疑你在读JDE文档。