diff --git a/doric-Qt/doric/demo/DoricDemoBridge.cpp b/doric-Qt/doric/demo/DoricDemoBridge.cpp index 200762f1..7264e4cb 100644 --- a/doric-Qt/doric/demo/DoricDemoBridge.cpp +++ b/doric-Qt/doric/demo/DoricDemoBridge.cpp @@ -22,9 +22,12 @@ void DoricDemoBridge::navigate(QVariant route) { name = "LayoutDemo.js"; break; case 3: - name = "SimpleDemo.js"; + name = "ModalDemo.js"; break; case 4: + name = "SimpleDemo.js"; + break; + case 5: name = "Snake.js"; break; } diff --git a/doric-Qt/doric/qml.qrc b/doric-Qt/doric/qml.qrc index 04a3532a..59d89c01 100644 --- a/doric-Qt/doric/qml.qrc +++ b/doric-Qt/doric/qml.qrc @@ -11,6 +11,7 @@ ../../doric-demo/bundle/src/Counter.js ../../doric-demo/bundle/src/Gobang.js ../../doric-demo/bundle/src/LayoutDemo.js + ../../doric-demo/bundle/src/ModalDemo.js ../../doric-demo/bundle/src/SimpleDemo.js ../../doric-demo/bundle/src/Snake.js diff --git a/doric-Qt/doric/resources/main.qml b/doric-Qt/doric/resources/main.qml index 64b103ab..2cdcc2f6 100644 --- a/doric-Qt/doric/resources/main.qml +++ b/doric-Qt/doric/resources/main.qml @@ -15,7 +15,7 @@ ApplicationWindow { ListView { width: parent.width - model: 5 + model: 6 delegate: Rectangle { Column { anchors.centerIn: parent @@ -29,8 +29,10 @@ ApplicationWindow { case 2: return "LayoutDemo.js" case 3: - return "SimpleDemo.js" + return "ModalDemo.js" case 4: + return "SimpleDemo.js" + case 5: return "Snake.js" } } diff --git a/doric-Qt/doric/utils/DoricLayouts.cpp b/doric-Qt/doric/utils/DoricLayouts.cpp index 02488292..afdbefd5 100644 --- a/doric-Qt/doric/utils/DoricLayouts.cpp +++ b/doric-Qt/doric/utils/DoricLayouts.cpp @@ -134,7 +134,8 @@ void DoricLayouts::measureSelf(QSizeF targetSize) { QQuickItem *parent = this->view->parentItem(); DoricLayouts *parentDoricLayout = (DoricLayouts *)(parent->property("doricLayout").toULongLong()); - if (parentDoricLayout->layoutType == DoricLayoutType::DoricHLayout && + if (parentDoricLayout != nullptr && + parentDoricLayout->layoutType == DoricLayoutType::DoricHLayout && this->weight > 0) { width = 0; setMeasuredWidth(0); @@ -155,7 +156,8 @@ void DoricLayouts::measureSelf(QSizeF targetSize) { QQuickItem *parent = this->view->parentItem(); DoricLayouts *parentDoricLayout = (DoricLayouts *)(parent->property("doricLayout").toULongLong()); - if (parentDoricLayout->layoutType == DoricLayoutType::DoricVLayout && + if (parentDoricLayout != nullptr && + parentDoricLayout->layoutType == DoricLayoutType::DoricVLayout && this->weight > 0) { height = 0; setMeasuredHeight(0);