Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to access assets folder from Qt on ios?
Forum Updated to NodeBB v4.3 + New Features

How to access assets folder from Qt on ios?

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vkjr
    wrote on last edited by
    #1

    'm writing cross-platform mobile application using Qt/QML. The app installs along with a small sqlite database that at start copied from assets to application data location and than should be accessed by the app. For this purpose I have DatabaseManager class. It contains function that provide path to assets on different platforms:

    @QString DatabaseManager::assetsPath()
    {
    QString assetsPath;
    #ifdef Q_OS_WIN
    assetsPath = QDir::toNativeSeparators("assets:/../database");
    #endif

    #ifdef Q_OS_ANDROID
    assetsPath = QDir::toNativeSeparators("assets:/database");
    #endif

    #ifdef Q_OS_IOS
    assetsPath = QDir::toNativeSeparators("assets:/database");
    #endif

    #ifdef Q_OS_MAC
    assetsPath = QDir::toNativeSeparators("assets:/database");
    #endif

    return assetsPath;
    

    }@

    Assets deployed in .pro file with following code:

    @folder_qml.source = qml/HookahMixes
    folder_qml.target = qml

    folder_db.source = database
    folder_db.target = .

    DEPLOYMENTFOLDERS = folder_qml folder_db@

    The problem is that "assets:/" prefix works well on Windows and Android but doesn't work for ios and Mac OS. So the question is: what path to assets should I use to find database on that platforms?

    Thanks.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved