Форум для тех, кто программирует под Android
-
Anonymous
QT для Android: как разрешить приложение писать файлы в папку документов
Сообщение
Anonymous »
Я пытаюсь запустить простое приложение QT Android, которое создает файл в папке документов. < /p>
Программа проста: < /p>
Код: Выделить всё
#include
#include
#include
#include
#include
#include
int main( int argc, char* argv[] )
{
QApplication app(argc, argv);
QMainWindow frame;
QString status = "";
auto folder = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
auto fileName = folder + "/file.txt";
// create a file:
std::fstream file;
file.open( fileName.toStdString().c_str(), std::ios_base::out );
file
Подробнее здесь: [url]https://stackoverflow.com/questions/79611441/qt-for-android-how-to-allow-app-to-write-files-to-documents-folder[/url]
1746654048
Anonymous
Я пытаюсь запустить простое приложение QT Android, которое создает файл в папке документов. < /p>
Программа проста: < /p>
[code]#include
#include
#include
#include
#include
#include
int main( int argc, char* argv[] )
{
QApplication app(argc, argv);
QMainWindow frame;
QString status = "";
auto folder = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
auto fileName = folder + "/file.txt";
// create a file:
std::fstream file;
file.open( fileName.toStdString().c_str(), std::ios_base::out );
file
Подробнее здесь: [url]https://stackoverflow.com/questions/79611441/qt-for-android-how-to-allow-app-to-write-files-to-documents-folder[/url]