diff --git a/doric-Qt/example/app/demo/DoricDemoBridge.cpp b/doric-Qt/example/app/demo/DoricDemoBridge.cpp index 9e93cb5a..c5c19074 100644 --- a/doric-Qt/example/app/demo/DoricDemoBridge.cpp +++ b/doric-Qt/example/app/demo/DoricDemoBridge.cpp @@ -8,6 +8,7 @@ #include "utils/DoricDraggableBridge.h" #include "utils/DoricImageBridge.h" #include "utils/DoricInputBridge.h" +#include "utils/DoricListBridge.h" #include "utils/DoricMouseAreaBridge.h" #include "utils/DoricSlideItemBridge.h" #include "utils/DoricSliderBridge.h" @@ -35,6 +36,8 @@ DoricDemoBridge::DoricDemoBridge(QQmlApplicationEngine *engine, QObject *parent) context->setContextProperty("sliderBridge", sliderBridge); DoricDraggableBridge *draggableBridge = new DoricDraggableBridge(); context->setContextProperty("draggableBridge", draggableBridge); + DoricListBridge *listBridge = new DoricListBridge(); + context->setContextProperty("listBridge", listBridge); } void DoricDemoBridge::navigate(QVariant source, QVariant alias) { diff --git a/doric-Qt/example/doric/doric.pro b/doric-Qt/example/doric/doric.pro index 4b0cb976..fb6c4e2c 100644 --- a/doric-Qt/example/doric/doric.pro +++ b/doric-Qt/example/doric/doric.pro @@ -72,6 +72,7 @@ SOURCES += \ utils/DoricImageBridge.cpp \ utils/DoricInputBridge.cpp \ utils/DoricLayouts.cpp \ + utils/DoricListBridge.cpp \ utils/DoricMouseAreaBridge.cpp \ utils/DoricSlideItemBridge.cpp \ utils/DoricSliderBridge.cpp \ @@ -169,6 +170,7 @@ HEADERS += \ utils/DoricImageBridge.h \ utils/DoricInputBridge.h \ utils/DoricLayouts.h \ + utils/DoricListBridge.h \ utils/DoricMouseAreaBridge.h \ utils/DoricNetworkService.h \ utils/DoricObjectFactory.h \ diff --git a/doric-Qt/example/doric/resources/list.qml b/doric-Qt/example/doric/resources/list.qml index dea66b71..acf7d963 100644 --- a/doric-Qt/example/doric/resources/list.qml +++ b/doric-Qt/example/doric/resources/list.qml @@ -45,4 +45,9 @@ ListView { console.log(tag, uuid + " onCurrentIndexChanged: " + this.currentIndex) } + delegate: Rectangle { + Component.onCompleted: { +// listBridge.getItemModel(index) + } + } } diff --git a/doric-Qt/example/doric/utils/DoricListBridge.cpp b/doric-Qt/example/doric/utils/DoricListBridge.cpp new file mode 100644 index 00000000..55cb73f3 --- /dev/null +++ b/doric-Qt/example/doric/utils/DoricListBridge.cpp @@ -0,0 +1,3 @@ +#include "DoricListBridge.h" + +DoricListBridge::DoricListBridge(QObject *parent) : QObject(parent) {} diff --git a/doric-Qt/example/doric/utils/DoricListBridge.h b/doric-Qt/example/doric/utils/DoricListBridge.h new file mode 100644 index 00000000..85e81cd4 --- /dev/null +++ b/doric-Qt/example/doric/utils/DoricListBridge.h @@ -0,0 +1,15 @@ +#ifndef DORICLISTBRIDGE_H +#define DORICLISTBRIDGE_H + +#include +#include + +#include "DoricExport.h" + +class DORIC_EXPORT DoricListBridge : public QObject { + Q_OBJECT +public: + explicit DoricListBridge(QObject *parent = nullptr); +}; + +#endif // DORICLISTBRIDGE_H