Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML absolute images path work on windows , while don’t work on mac , why
Forum Updated to NodeBB v4.3 + New Features

QML absolute images path work on windows , while don’t work on mac , why

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.0k 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.
  • B Offline
    B Offline
    brucewuu
    wrote on last edited by
    #1

    in order to provide skin options for applications , I couldn’t put the images in qrc files , while I put qml files in qrc files , because I want to hide these qml files to customers , I pass the absoulte path (get from QDir::currentPath()) and use QDeclarativeContext::setContextProperty(“mainWidget”,this) to pass the absolute path to qml , and in my qml files , I construct the images path like this ,source:mainWidget.absolutePath +”/images/top_bg.png” , and it works well on windows , in debug folder , I put the images folder which contains all the images in debug folder with exe in the same folder, and it can find the images and show the application UI well , while on mac , at first I try to make with bundle option , it can’t work , then I make without bundle option(in pro file , with CONFIG -= app_bundle ) , and still it can’t find the images , and it said errors :
    qrc:/qml/BottomStatusLine.qml:8:5: QML Image: Cannot open: qrc:/Users/macmaya/images/statebar_bg.png
    qrc:/qml/NDuoDemo.qml:20:9: QML BorderImage: Cannot open: qrc:/Users/macmaya/images/shadow.png

    It automatically take it as the qrc source files , because the qml files are in qrc , while it can work on windows , while it can’t work on
    mac , and if I want to make it as bundle option , how could I do to make it recognize the images . thanks guys .

    wish all the best to you from
    bruce wuu
    Autodesk China Inc.
    SW Developer
    M&E Product Developerment Group
    Work 137 6411 8921
    bruce.wu@autodesk.com

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Closed. Duplicate of http://developer.qt.nokia.com/forums/viewthread/7403/

      You are note likely to get any help if you keep reposting your unanswered questions. Especially if reposted within a day.

      http://www.catb.org/~esr/faqs/smart-questions.html

      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