apply slide item
This commit is contained in:
parent
46e28577d9
commit
94045f11bf
@ -8,6 +8,7 @@
|
||||
#include "utils/DoricImageBridge.h"
|
||||
#include "utils/DoricInputBridge.h"
|
||||
#include "utils/DoricMouseAreaBridge.h"
|
||||
#include "utils/DoricSlideItemBridge.h"
|
||||
#include "utils/DoricSwitchBridge.h"
|
||||
#include "utils/DoricUtils.h"
|
||||
|
||||
@ -120,4 +121,6 @@ void DoricDemoBridge::navigate(QVariant route) {
|
||||
context->setContextProperty("inputBridge", inputBridge);
|
||||
DoricSwitchBridge *switchBridge = new DoricSwitchBridge();
|
||||
context->setContextProperty("switchBridge", switchBridge);
|
||||
DoricSlideItemBridge *slideItemBridge = new DoricSlideItemBridge();
|
||||
context->setContextProperty("slideItemBridge", slideItemBridge);
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ SOURCES += \
|
||||
utils/DoricInputBridge.cpp \
|
||||
utils/DoricLayouts.cpp \
|
||||
utils/DoricMouseAreaBridge.cpp \
|
||||
utils/DoricSlideItemBridge.cpp \
|
||||
utils/DoricSwitchBridge.cpp \
|
||||
widget/flex/FlexLayout.cpp \
|
||||
widget/flex/FlexLayoutConfig.cpp \
|
||||
@ -147,6 +148,7 @@ HEADERS += \
|
||||
utils/DoricMouseAreaBridge.h \
|
||||
utils/DoricNetworkService.h \
|
||||
utils/DoricObjectFactory.h \
|
||||
utils/DoricSlideItemBridge.h \
|
||||
utils/DoricSwitchBridge.h \
|
||||
utils/DoricThreadMode.h \
|
||||
utils/DoricUtils.h \
|
||||
|
@ -19,12 +19,16 @@ Rectangle {
|
||||
console.log(tag, uuid + " onWidthChanged: " + this.width)
|
||||
|
||||
updateGradient()
|
||||
|
||||
slideItemBridge.apply(wrapper)
|
||||
}
|
||||
|
||||
onHeightChanged: {
|
||||
console.log(tag, uuid + " onHeightChanged: " + this.height)
|
||||
|
||||
updateGradient()
|
||||
|
||||
slideItemBridge.apply(wrapper)
|
||||
}
|
||||
|
||||
color: 'transparent'
|
||||
|
@ -18,3 +18,5 @@ QQuickItem *DoricSlideItemNode::build() {
|
||||
item->setProperty("wrapper", QString::number((qint64)this));
|
||||
return item;
|
||||
}
|
||||
|
||||
void DoricSlideItemNode::apply() { getLayouts()->apply(); }
|
||||
|
@ -10,6 +10,8 @@ public:
|
||||
using DoricStackNode::DoricStackNode;
|
||||
|
||||
QQuickItem *build() override;
|
||||
|
||||
void apply();
|
||||
};
|
||||
|
||||
#endif // DORICSLIDEITEMNODE_H
|
||||
|
13
doric-Qt/example/doric/utils/DoricSlideItemBridge.cpp
Normal file
13
doric-Qt/example/doric/utils/DoricSlideItemBridge.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "DoricSlideItemBridge.h"
|
||||
|
||||
#include "shader/slider/DoricSlideItemNode.h"
|
||||
|
||||
DoricSlideItemBridge::DoricSlideItemBridge(QObject *parent) : QObject(parent) {}
|
||||
|
||||
void DoricSlideItemBridge::apply(QString pointer) {
|
||||
QObject *object = (QObject *)(pointer.toULongLong());
|
||||
DoricSlideItemNode *slideItemNode =
|
||||
dynamic_cast<DoricSlideItemNode *>(object);
|
||||
|
||||
slideItemNode->apply();
|
||||
}
|
19
doric-Qt/example/doric/utils/DoricSlideItemBridge.h
Normal file
19
doric-Qt/example/doric/utils/DoricSlideItemBridge.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef DORICSLIDEITEMBRIDGE_H
|
||||
#define DORICSLIDEITEMBRIDGE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
#include "DoricExport.h"
|
||||
|
||||
class DORIC_EXPORT DoricSlideItemBridge : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DoricSlideItemBridge(QObject *parent = nullptr);
|
||||
|
||||
Q_INVOKABLE
|
||||
void apply(QString pointer);
|
||||
signals:
|
||||
};
|
||||
|
||||
#endif // DORICSLIDEITEMBRIDGE_H
|
Reference in New Issue
Block a user