mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 18:57:52 -06:00
Allow PackageList to be used as a model from QML
QML is leading here and holding the pointers for creation and destruction. Contributes to issue CURA-8556.
This commit is contained in:
parent
4337e81b77
commit
3138452f94
3 changed files with 19 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
import os.path
|
||||
from PyQt5.QtCore import pyqtSlot
|
||||
from PyQt5.QtQml import qmlRegisterType
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
|
||||
from cura.ApplicationMetadata import CuraSDKVersion
|
||||
|
@ -12,6 +13,8 @@ from UM.Extension import Extension # We are implementing the main object of an
|
|||
from UM.Logger import Logger
|
||||
from UM.PluginRegistry import PluginRegistry # To find out where we are stored (the proper way).
|
||||
|
||||
from .PackageList import PackageList # To register this type with QML.
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from PyQt5.QtCore import QObject
|
||||
|
||||
|
@ -27,6 +30,8 @@ class Marketplace(Extension):
|
|||
super().__init__()
|
||||
self._window: Optional["QObject"] = None # If the window has been loaded yet, it'll be cached in here.
|
||||
|
||||
qmlRegisterType(PackageList, "Cura", 1, 7, "PackageList")
|
||||
|
||||
@pyqtSlot()
|
||||
def show(self) -> None:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue