I am working on QML app and here is project structure:
projectStructure.jpg
As you can see, in I have resource file ueicons.qrc, which contains icons, used in app. I tried to add icons with:
Qt Code:
  1. import QtQuick 2.4
  2. import QtQuick.Controls 1.3
  3. import QtQuick.Window 2.2
  4. import QtQuick.Dialogs 1.2
  5. import QtMultimedia 5.0
  6. import QtQuick.Layouts 1.0
  7. import QtTest 1.1
  8.  
  9. import "gui/windows"
  10. import "gui/items"
  11.  
  12. ApplicationWindow
  13. {
  14. id: ueWindowMain
  15.  
  16. title: qsTr("testapp")
  17.  
  18. width: Screen.desktopAvailableWidth
  19. height: Screen.desktopAvailableWidth
  20.  
  21. visible: true
  22.  
  23. opacity: 1.0
  24.  
  25. contentOrientation: Qt.LandscapeOrientation
  26.  
  27. color: "black"
  28.  
  29. UeKeypad
  30. {
  31. id: ueLoginKeypad
  32. } // ueLoginKeypad
  33.  
  34. StatusBar
  35. {
  36. id: ueStatusBar
  37.  
  38. RowLayout
  39. {
  40. spacing: 8
  41.  
  42. UeStatusIndicator
  43. {
  44. id: ueStatusIndicatorDatabaseConnected
  45.  
  46. ueParamImageStatusOn: "qrc:///ueIcons/ueDbConnectionOk.png"
  47. ueParamImageStatusOff: "qrc:///ueIcons/ueDbConnectionError.png"
  48. } // ueStatusIndicatorDatabaseConnected
  49. } // RowLayout
  50. } // ueStatusBar
  51. } // ueWindowMain
To copy to clipboard, switch view to plain text mode 
And when I run this app, I get following QML error:
QML Image: Cannot open: qrc:///ueIcons/ueDbConnectionError.png
Why?