mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 20:29:05 +08:00
Use the right resource path for locating Qml resources
This commit is contained in:
parent
9888a6eb42
commit
f081bf4026
@ -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():
|
||||||
|
@ -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")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user