mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -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
|
@ -9,7 +9,7 @@ from UM.Qt.ListModel import ListModel
|
|||
from UM.TaskManagement.HttpRequestManager import HttpRequestManager # To request the package list from the API.
|
||||
from UM.TaskManagement.HttpRequestScope import JsonDecoratorScope # To request JSON responses from the API.
|
||||
|
||||
from .Marketplace import PACKAGES_URL # To get the list of packages.
|
||||
from . import Marketplace # To get the list of packages. Imported this way to prevent circular imports.
|
||||
from .PackageModel import PackageModel # This list is a list of PackageModels.
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -47,7 +47,7 @@ class PackageList(ListModel):
|
|||
|
||||
http = HttpRequestManager.getInstance()
|
||||
http.get(
|
||||
PACKAGES_URL,
|
||||
Marketplace.PACKAGES_URL,
|
||||
scope = self._scope,
|
||||
callback = self._parseResponse,
|
||||
error_callback = self._onError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue