add list bridge

This commit is contained in:
王劲鹏 2021-06-11 17:59:29 +08:00 committed by osborn
parent 5203113e40
commit 738566e043
5 changed files with 28 additions and 0 deletions

View File

@ -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) {

View File

@ -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 \

View File

@ -45,4 +45,9 @@ ListView {
console.log(tag, uuid + " onCurrentIndexChanged: " + this.currentIndex)
}
delegate: Rectangle {
Component.onCompleted: {
// listBridge.getItemModel(index)
}
}
}

View File

@ -0,0 +1,3 @@
#include "DoricListBridge.h"
DoricListBridge::DoricListBridge(QObject *parent) : QObject(parent) {}

View File

@ -0,0 +1,15 @@
#ifndef DORICLISTBRIDGE_H
#define DORICLISTBRIDGE_H
#include <QObject>
#include <QVariant>
#include "DoricExport.h"
class DORIC_EXPORT DoricListBridge : public QObject {
Q_OBJECT
public:
explicit DoricListBridge(QObject *parent = nullptr);
};
#endif // DORICLISTBRIDGE_H