add slider, slider node & pure call response

This commit is contained in:
王劲鹏
2021-05-10 16:09:29 +08:00
committed by osborn
parent 3721c856fb
commit 3531a28f13
10 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1 @@
#include "DoricSlideItemNode.h"

View File

@@ -0,0 +1,11 @@
#ifndef DORICSLIDEITEMNODE_H
#define DORICSLIDEITEMNODE_H
#include "shader/DoricStackNode.h"
class DoricSlideItemNode : public DoricStackNode {
public:
using DoricStackNode::DoricStackNode;
};
#endif // DORICSLIDEITEMNODE_H

View File

@@ -35,3 +35,12 @@ void DoricSliderNode::blendSubNode(QJsonValue subProperties) {
void DoricSliderNode::blend(QJsonValue jsValue) {}
void DoricSliderNode::blend(QQuickItem *view, QString name, QJsonValue prop) {}
void DoricSliderNode::afterBlended(QJsonValue prop) {
if (this->childNodes.length() != this->itemCount) {
QVariantList args;
args.append(this->childNodes.length());
args.append(this->itemCount);
this->pureCallJSResponse("renderBunchedItems", args);
}
}

View File

@@ -1,10 +1,19 @@
#ifndef DORICSLIDERNODE_H
#define DORICSLIDERNODE_H
#include "DoricSlideItemNode.h"
#include "shader/DoricSuperNode.h"
class DoricSliderNode : public DoricSuperNode {
private:
int itemCount = 0;
QString renderPageFuncId;
int batchCount = 15;
QString onPageSelectedFuncId;
bool loop = false;
QList<DoricSlideItemNode *> childNodes;
public:
using DoricSuperNode::DoricSuperNode;
@@ -17,6 +26,8 @@ public:
virtual void blend(QJsonValue jsValue) override;
virtual void blend(QQuickItem *view, QString name, QJsonValue prop) override;
virtual void afterBlended(QJsonValue prop) override;
};
#endif // DORICSLIDERNODE_H