Use the right resource path for locating Qml resources

This commit is contained in:
Arjen Hiemstra 2015-08-21 18:29:13 +02:00
parent 9888a6eb42
commit f081bf4026
2 changed files with 5 additions and 1 deletions

View file

@ -40,6 +40,7 @@ from . import MultiMaterialDecorator
from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS
from PyQt5.QtGui import QColor, QIcon from PyQt5.QtGui import QColor, QIcon
from PyQt5.QtQml import qmlRegisterUncreatableType
import platform import platform
import sys import sys
@ -206,6 +207,8 @@ class CuraApplication(QtApplication):
self._cura_actions = CuraActions.CuraActions(self) self._cura_actions = CuraActions.CuraActions(self)
engine.rootContext().setContextProperty("CuraActions", self._cura_actions) engine.rootContext().setContextProperty("CuraActions", self._cura_actions)
qmlRegisterUncreatableType(CuraApplication, "Cura", 1, 0, "ResourceTypes", "Just an Enum type")
def onSelectionChanged(self): def onSelectionChanged(self):
if Selection.hasSelection(): if Selection.hasSelection():
if not self.getController().getActiveTool(): if not self.getController().getActiveTool():

View file

@ -7,6 +7,7 @@ import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.0 as UM import UM 1.0 as UM
import Cura 1.0 as Cura
UM.Wizard UM.Wizard
{ {
@ -15,7 +16,7 @@ UM.Wizard
wizardPages: [ wizardPages: [
{ {
title: "Add Printer", title: "Add Printer",
page: "AddMachine.qml" page: UM.Resources.getPath(Cura.ResourceTypes.QmlFiles, "WizardPages/AddMachine.qml")
} }
] ]