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:
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtMultimedia 5.0
import QtQuick.Layouts 1.0
import QtTest 1.1
import "gui/windows"
import "gui/items"
ApplicationWindow
{
id: ueWindowMain
title: qsTr("testapp")
width: Screen.desktopAvailableWidth
height: Screen.desktopAvailableWidth
visible: true
opacity: 1.0
contentOrientation: Qt.LandscapeOrientation
color: "black"
UeKeypad
{
id: ueLoginKeypad
} // ueLoginKeypad
StatusBar
{
id: ueStatusBar
RowLayout
{
spacing: 8
UeStatusIndicator
{
id: ueStatusIndicatorDatabaseConnected
ueParamImageStatusOn: "qrc:///ueIcons/ueDbConnectionOk.png"
ueParamImageStatusOff: "qrc:///ueIcons/ueDbConnectionError.png"
} // ueStatusIndicatorDatabaseConnected
} // RowLayout
} // ueStatusBar
} // ueWindowMain
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtMultimedia 5.0
import QtQuick.Layouts 1.0
import QtTest 1.1
import "gui/windows"
import "gui/items"
ApplicationWindow
{
id: ueWindowMain
title: qsTr("testapp")
width: Screen.desktopAvailableWidth
height: Screen.desktopAvailableWidth
visible: true
opacity: 1.0
contentOrientation: Qt.LandscapeOrientation
color: "black"
UeKeypad
{
id: ueLoginKeypad
} // ueLoginKeypad
StatusBar
{
id: ueStatusBar
RowLayout
{
spacing: 8
UeStatusIndicator
{
id: ueStatusIndicatorDatabaseConnected
ueParamImageStatusOn: "qrc:///ueIcons/ueDbConnectionOk.png"
ueParamImageStatusOff: "qrc:///ueIcons/ueDbConnectionError.png"
} // ueStatusIndicatorDatabaseConnected
} // RowLayout
} // ueStatusBar
} // 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?
Bookmarks