add slider bridge
This commit is contained in:
@@ -47,7 +47,7 @@ void DoricSliderNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
} else if (name == "batchCount") {
|
||||
this->batchCount = prop.toInt();
|
||||
} else if (name == "onPageSlided") {
|
||||
this->onPageSelectedFuncId = prop.toString();
|
||||
this->onPageSlidedFuncId = prop.toString();
|
||||
} else if (name == "loop") {
|
||||
this->loop = prop.toBool();
|
||||
} else {
|
||||
@@ -88,3 +88,10 @@ void DoricSliderNode::afterBlended(QJsonValue prop) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoricSliderNode::onPageSlided() {
|
||||
int currentIndex = mView->property("currentIndex").toInt();
|
||||
QVariantList args;
|
||||
args.append(currentIndex);
|
||||
callJSResponse(this->onPageSlidedFuncId, args);
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ private:
|
||||
int itemCount = 0;
|
||||
QString renderPageFuncId;
|
||||
int batchCount = 15;
|
||||
QString onPageSelectedFuncId;
|
||||
QString onPageSlidedFuncId;
|
||||
bool loop = false;
|
||||
QList<DoricSlideItemNode *> childNodes;
|
||||
|
||||
@@ -28,6 +28,8 @@ public:
|
||||
virtual void blend(QQuickItem *view, QString name, QJsonValue prop) override;
|
||||
|
||||
virtual void afterBlended(QJsonValue prop) override;
|
||||
|
||||
void onPageSlided();
|
||||
};
|
||||
|
||||
#endif // DORICSLIDERNODE_H
|
||||
|
Reference in New Issue
Block a user