From d9b13de4e86d33bc533855baa3e70492288b4ba3 Mon Sep 17 00:00:00 2001 From: Soheil Armin Date: Thu, 11 Jul 2024 10:43:13 +0300 Subject: [PATCH] Android: Rename QtQuickView.loadComponent() to .loadContent() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pick-to: 6.8 Task-number: QTBUG-126976 Task-number: QTBUG-127084 Change-Id: Idf259c5186db04eb53d4369c2e00fa17f40684b6 Reviewed-by: Tinja Paavoseppä Reviewed-by: Ulf Hermann Reviewed-by: Assam Boudjelthia --- .../org/qtproject/qt/android/QtQuickView.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/quick/jar/org/qtproject/qt/android/QtQuickView.java b/src/quick/jar/org/qtproject/qt/android/QtQuickView.java index 03af35c99a..7130fb2b56 100644 --- a/src/quick/jar/org/qtproject/qt/android/QtQuickView.java +++ b/src/quick/jar/org/qtproject/qt/android/QtQuickView.java @@ -110,18 +110,18 @@ public class QtQuickView extends QtView { * This overload accepts an array of strings in the case where the QML content should load * QML modules from custom paths. *

- * @param qmlComponent an instance of an object that extends QtQuickViewContent + * @param qmlContent an instance of an object that extends QtQuickViewContent * @param qmlImportPaths an array of strings for additional import paths to be passed to * QQmlEngine, or null if additional import paths are not required * @throws InvalidParameterException if QtQuickViewContent does not contain valid information * about the module name, and the qrc path. */ // TODO: QTBUG-125620 -- Refresh/reset import paths when loading a new component - public void loadComponent(T qmlComponent, String[] qmlImportPaths) + public void loadContent(T qmlContent, String[] qmlImportPaths) throws InvalidParameterException { - String libName = qmlComponent.getLibraryName(); - String qmlUri = qmlComponent.getFilePath(); + String libName = qmlContent.getLibraryName(); + String qmlUri = qmlContent.getFilePath(); if (libName == null || libName.isEmpty()) { throw new InvalidParameterException( @@ -139,9 +139,9 @@ public class QtQuickView extends QtView { if (m_loadedComponent != null) m_loadedComponent.clear(); - m_loadedComponent = new WeakReference<>(qmlComponent); - qmlComponent.detachView(); - qmlComponent.attachView(this); + m_loadedComponent = new WeakReference<>(qmlContent); + qmlContent.detachView(); + qmlContent.attachView(this); // The first QQuickView creation happen after first libs loading // and windowReference() returns a reference to native QQuickView // instance, after that. We don't load library again if the view @@ -158,14 +158,14 @@ public class QtQuickView extends QtView { * Loads QML content represented by a QtQuickViewContent. The library name and the qrc path of * the QML content will be extracted from the QtQuickViewContent to load the QML component. *

- * @param qmlComponent an instance of a class that extends QtQuickViewContent + * @param qmlContent an instance of a class that extends QtQuickViewContent * @throws InvalidParameterException if QtQuickViewContent does not contain valid information * about the module name, and the qrc path. */ - public void loadComponent(T qmlComponent) + public void loadContent(T qmlContent) throws InvalidParameterException { - loadComponent(qmlComponent, null); + loadContent(qmlContent, null); } @Override