diff --git a/config/common.gypi b/config/common.gypi index 9731ea27c..2b44d6253 100644 --- a/config/common.gypi +++ b/config/common.gypi @@ -5,8 +5,8 @@ 'qt_home_dir': ' { view.setStyleSheet( ` background-color: green; - qproperty-flex: 1; - qproperty-alignItems: center; + qproperty-alignItems:center; qproperty-justifyContent:center; ` ); @@ -67,7 +66,10 @@ const testFlexLayout = () => { const label = new QLabel(); label.setText("Hello12321"); - label.setStyleSheet("background-color:blue; color:white;"); + label.setStyleSheet(` + background-color:blue; + color:white; + `); flayout.addWidget(label, label.getFlexNode()); @@ -77,5 +79,5 @@ const testFlexLayout = () => { return win; }; -(global as any).win1 = testGridLayout(); //to keep gc from collecting -// (global as any).win2 = testFlexLayout(); //to keep gc from collecting +// (global as any).win1 = testGridLayout(); //to keep gc from collecting +(global as any).win2 = testFlexLayout(); //to keep gc from collecting diff --git a/src/cpp/QtGui/QWidget/nwidget_moc.cpp b/src/cpp/QtGui/QWidget/nwidget_moc.cpp index 3fcd052e5..39fada887 100644 --- a/src/cpp/QtGui/QWidget/nwidget_moc.cpp +++ b/src/cpp/QtGui/QWidget/nwidget_moc.cpp @@ -21,8 +21,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_NWidget_t { - QByteArrayData data[1]; - char stringdata0[8]; + QByteArrayData data[45]; + char stringdata0[485]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -31,10 +31,67 @@ struct qt_meta_stringdata_NWidget_t { ) static const qt_meta_stringdata_NWidget_t qt_meta_stringdata_NWidget = { { -QT_MOC_LITERAL(0, 0, 7) // "NWidget" +QT_MOC_LITERAL(0, 0, 7), // "NWidget" +QT_MOC_LITERAL(1, 8, 7), // "display" +QT_MOC_LITERAL(2, 16, 10), // "alignItems" +QT_MOC_LITERAL(3, 27, 12), // "alignContent" +QT_MOC_LITERAL(4, 40, 9), // "alignSelf" +QT_MOC_LITERAL(5, 50, 14), // "justifyContent" +QT_MOC_LITERAL(6, 65, 9), // "direction" +QT_MOC_LITERAL(7, 75, 13), // "flexDirection" +QT_MOC_LITERAL(8, 89, 8), // "overflow" +QT_MOC_LITERAL(9, 98, 8), // "position" +QT_MOC_LITERAL(10, 107, 8), // "flexWrap" +QT_MOC_LITERAL(11, 116, 4), // "flex" +QT_MOC_LITERAL(12, 121, 8), // "flexGrow" +QT_MOC_LITERAL(13, 130, 10), // "flexShrink" +QT_MOC_LITERAL(14, 141, 11), // "aspectRatio" +QT_MOC_LITERAL(15, 153, 3), // "top" +QT_MOC_LITERAL(16, 157, 5), // "right" +QT_MOC_LITERAL(17, 163, 6), // "bottom" +QT_MOC_LITERAL(18, 170, 4), // "left" +QT_MOC_LITERAL(19, 175, 9), // "flexBasis" +QT_MOC_LITERAL(20, 185, 8), // "minWidth" +QT_MOC_LITERAL(21, 194, 9), // "minHeight" +QT_MOC_LITERAL(22, 204, 8), // "maxWidth" +QT_MOC_LITERAL(23, 213, 9), // "maxHeight" +QT_MOC_LITERAL(24, 223, 10), // "paddingTop" +QT_MOC_LITERAL(25, 234, 12), // "paddingRight" +QT_MOC_LITERAL(26, 247, 13), // "paddingBottom" +QT_MOC_LITERAL(27, 261, 11), // "paddingLeft" +QT_MOC_LITERAL(28, 273, 17), // "paddingHorizontal" +QT_MOC_LITERAL(29, 291, 15), // "paddingVertical" +QT_MOC_LITERAL(30, 307, 7), // "padding" +QT_MOC_LITERAL(31, 315, 9), // "marginTop" +QT_MOC_LITERAL(32, 325, 11), // "marginRight" +QT_MOC_LITERAL(33, 337, 12), // "marginBottom" +QT_MOC_LITERAL(34, 350, 10), // "marginLeft" +QT_MOC_LITERAL(35, 361, 16), // "marginHorizontal" +QT_MOC_LITERAL(36, 378, 14), // "marginVertical" +QT_MOC_LITERAL(37, 393, 6), // "margin" +QT_MOC_LITERAL(38, 400, 9), // "borderTop" +QT_MOC_LITERAL(39, 410, 11), // "borderRight" +QT_MOC_LITERAL(40, 422, 12), // "borderBottom" +QT_MOC_LITERAL(41, 435, 10), // "borderLeft" +QT_MOC_LITERAL(42, 446, 16), // "borderHorizontal" +QT_MOC_LITERAL(43, 463, 14), // "borderVertical" +QT_MOC_LITERAL(44, 478, 6) // "border" }, - "NWidget" + "NWidget\0display\0alignItems\0alignContent\0" + "alignSelf\0justifyContent\0direction\0" + "flexDirection\0overflow\0position\0" + "flexWrap\0flex\0flexGrow\0flexShrink\0" + "aspectRatio\0top\0right\0bottom\0left\0" + "flexBasis\0minWidth\0minHeight\0maxWidth\0" + "maxHeight\0paddingTop\0paddingRight\0" + "paddingBottom\0paddingLeft\0paddingHorizontal\0" + "paddingVertical\0padding\0marginTop\0" + "marginRight\0marginBottom\0marginLeft\0" + "marginHorizontal\0marginVertical\0margin\0" + "borderTop\0borderRight\0borderBottom\0" + "borderLeft\0borderHorizontal\0borderVertical\0" + "border" }; #undef QT_MOC_LITERAL @@ -45,17 +102,170 @@ static const uint qt_meta_data_NWidget[] = { 0, // classname 0, 0, // classinfo 0, 0, // methods - 0, 0, // properties + 44, 14, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount + // properties: name, type, flags + 1, QMetaType::QString, 0x00095003, + 2, QMetaType::QString, 0x00095003, + 3, QMetaType::QString, 0x00095003, + 4, QMetaType::QString, 0x00095003, + 5, QMetaType::QString, 0x00095003, + 6, QMetaType::QString, 0x00095003, + 7, QMetaType::QString, 0x00095003, + 8, QMetaType::QString, 0x00095003, + 9, QMetaType::QString, 0x00095003, + 10, QMetaType::QString, 0x00095003, + 11, QMetaType::Float, 0x00095003, + 12, QMetaType::Float, 0x00095003, + 13, QMetaType::Float, 0x00095003, + 14, QMetaType::Float, 0x00095003, + 15, QMetaType::QString, 0x00095003, + 16, QMetaType::QString, 0x00095003, + 17, QMetaType::QString, 0x00095003, + 18, QMetaType::QString, 0x00095003, + 19, QMetaType::QString, 0x00095003, + 20, QMetaType::QString, 0x00095003, + 21, QMetaType::QString, 0x00095003, + 22, QMetaType::QString, 0x00095003, + 23, QMetaType::QString, 0x00095003, + 24, QMetaType::QString, 0x00095003, + 25, QMetaType::QString, 0x00095003, + 26, QMetaType::QString, 0x00095003, + 27, QMetaType::QString, 0x00095003, + 28, QMetaType::QString, 0x00095003, + 29, QMetaType::QString, 0x00095003, + 30, QMetaType::QString, 0x00095003, + 31, QMetaType::QString, 0x00095003, + 32, QMetaType::QString, 0x00095003, + 33, QMetaType::QString, 0x00095003, + 34, QMetaType::QString, 0x00095003, + 35, QMetaType::QString, 0x00095003, + 36, QMetaType::QString, 0x00095003, + 37, QMetaType::QString, 0x00095003, + 38, QMetaType::Float, 0x00095003, + 39, QMetaType::Float, 0x00095003, + 40, QMetaType::Float, 0x00095003, + 41, QMetaType::Float, 0x00095003, + 42, QMetaType::Float, 0x00095003, + 43, QMetaType::Float, 0x00095003, + 44, QMetaType::Float, 0x00095003, + 0 // eod }; void NWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { + +#ifndef QT_NO_PROPERTIES + if (_c == QMetaObject::ReadProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: *reinterpret_cast< QString*>(_v) = _t->_yDisplay; break; + case 1: *reinterpret_cast< QString*>(_v) = _t->_yAlignItems; break; + case 2: *reinterpret_cast< QString*>(_v) = _t->_yAlignContent; break; + case 3: *reinterpret_cast< QString*>(_v) = _t->_yAlignSelf; break; + case 4: *reinterpret_cast< QString*>(_v) = _t->_yJustifyContent; break; + case 5: *reinterpret_cast< QString*>(_v) = _t->_yDirection; break; + case 6: *reinterpret_cast< QString*>(_v) = _t->_yFlexDirection; break; + case 7: *reinterpret_cast< QString*>(_v) = _t->_yOverflow; break; + case 8: *reinterpret_cast< QString*>(_v) = _t->_yPosition; break; + case 9: *reinterpret_cast< QString*>(_v) = _t->_yFlexWrap; break; + case 10: *reinterpret_cast< float*>(_v) = _t->_yFlex; break; + case 11: *reinterpret_cast< float*>(_v) = _t->_yFlexGrow; break; + case 12: *reinterpret_cast< float*>(_v) = _t->_yFlexShrink; break; + case 13: *reinterpret_cast< float*>(_v) = _t->_yAspectRatio; break; + case 14: *reinterpret_cast< QString*>(_v) = _t->_yTop; break; + case 15: *reinterpret_cast< QString*>(_v) = _t->_yRight; break; + case 16: *reinterpret_cast< QString*>(_v) = _t->_yBottom; break; + case 17: *reinterpret_cast< QString*>(_v) = _t->_yLeft; break; + case 18: *reinterpret_cast< QString*>(_v) = _t->_yFlexBasis; break; + case 19: *reinterpret_cast< QString*>(_v) = _t->_yMinWidth; break; + case 20: *reinterpret_cast< QString*>(_v) = _t->_yMinHeight; break; + case 21: *reinterpret_cast< QString*>(_v) = _t->_yMaxWidth; break; + case 22: *reinterpret_cast< QString*>(_v) = _t->_yMaxHeight; break; + case 23: *reinterpret_cast< QString*>(_v) = _t->_yPaddingTop; break; + case 24: *reinterpret_cast< QString*>(_v) = _t->_yPaddingRight; break; + case 25: *reinterpret_cast< QString*>(_v) = _t->_yPaddingBottom; break; + case 26: *reinterpret_cast< QString*>(_v) = _t->_yPaddingLeft; break; + case 27: *reinterpret_cast< QString*>(_v) = _t->_yPaddingHorizontal; break; + case 28: *reinterpret_cast< QString*>(_v) = _t->_yPaddingVertical; break; + case 29: *reinterpret_cast< QString*>(_v) = _t->_yPadding; break; + case 30: *reinterpret_cast< QString*>(_v) = _t->_yMarginTop; break; + case 31: *reinterpret_cast< QString*>(_v) = _t->_yMarginRight; break; + case 32: *reinterpret_cast< QString*>(_v) = _t->_yMarginBottom; break; + case 33: *reinterpret_cast< QString*>(_v) = _t->_yMarginLeft; break; + case 34: *reinterpret_cast< QString*>(_v) = _t->_yMarginHorizontal; break; + case 35: *reinterpret_cast< QString*>(_v) = _t->_yMarginVertical; break; + case 36: *reinterpret_cast< QString*>(_v) = _t->_yMargin; break; + case 37: *reinterpret_cast< float*>(_v) = _t->_yBorderTop; break; + case 38: *reinterpret_cast< float*>(_v) = _t->_yBorderRight; break; + case 39: *reinterpret_cast< float*>(_v) = _t->_yBorderBottom; break; + case 40: *reinterpret_cast< float*>(_v) = _t->_yBorderLeft; break; + case 41: *reinterpret_cast< float*>(_v) = _t->_yBorderHorizontal; break; + case 42: *reinterpret_cast< float*>(_v) = _t->_yBorderVertical; break; + case 43: *reinterpret_cast< float*>(_v) = _t->_yBorder; break; + default: break; + } + } else if (_c == QMetaObject::WriteProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: _t->setYDisplay(*reinterpret_cast< QString*>(_v)); break; + case 1: _t->setYAlignItems(*reinterpret_cast< QString*>(_v)); break; + case 2: _t->setYAlignContent(*reinterpret_cast< QString*>(_v)); break; + case 3: _t->setYAlignSelf(*reinterpret_cast< QString*>(_v)); break; + case 4: _t->setYJustifyContent(*reinterpret_cast< QString*>(_v)); break; + case 5: _t->setYDirection(*reinterpret_cast< QString*>(_v)); break; + case 6: _t->setYFlexDirection(*reinterpret_cast< QString*>(_v)); break; + case 7: _t->setYOverflow(*reinterpret_cast< QString*>(_v)); break; + case 8: _t->setYPosition(*reinterpret_cast< QString*>(_v)); break; + case 9: _t->setYFlexWrap(*reinterpret_cast< QString*>(_v)); break; + case 10: _t->setYFlex(*reinterpret_cast< float*>(_v)); break; + case 11: _t->setYFlexGrow(*reinterpret_cast< float*>(_v)); break; + case 12: _t->setYFlexShrink(*reinterpret_cast< float*>(_v)); break; + case 13: _t->setYAspectRatio(*reinterpret_cast< float*>(_v)); break; + case 14: _t->setYNodeTop(*reinterpret_cast< QString*>(_v)); break; + case 15: _t->setYNodeRight(*reinterpret_cast< QString*>(_v)); break; + case 16: _t->setYNodeBottom(*reinterpret_cast< QString*>(_v)); break; + case 17: _t->setYNodeLeft(*reinterpret_cast< QString*>(_v)); break; + case 18: _t->setYFlexBasis(*reinterpret_cast< QString*>(_v)); break; + case 19: _t->setYMinWidth(*reinterpret_cast< QString*>(_v)); break; + case 20: _t->setYMinHeight(*reinterpret_cast< QString*>(_v)); break; + case 21: _t->setYMaxWidth(*reinterpret_cast< QString*>(_v)); break; + case 22: _t->setYMaxHeight(*reinterpret_cast< QString*>(_v)); break; + case 23: _t->setYPaddingTop(*reinterpret_cast< QString*>(_v)); break; + case 24: _t->setYPaddingRight(*reinterpret_cast< QString*>(_v)); break; + case 25: _t->setYPaddingBottom(*reinterpret_cast< QString*>(_v)); break; + case 26: _t->setYPaddingLeft(*reinterpret_cast< QString*>(_v)); break; + case 27: _t->setYPaddingHorizontal(*reinterpret_cast< QString*>(_v)); break; + case 28: _t->setYPaddingVertical(*reinterpret_cast< QString*>(_v)); break; + case 29: _t->setYPadding(*reinterpret_cast< QString*>(_v)); break; + case 30: _t->setYMarginTop(*reinterpret_cast< QString*>(_v)); break; + case 31: _t->setYMarginRight(*reinterpret_cast< QString*>(_v)); break; + case 32: _t->setYMarginBottom(*reinterpret_cast< QString*>(_v)); break; + case 33: _t->setYMarginLeft(*reinterpret_cast< QString*>(_v)); break; + case 34: _t->setYMarginHorizontal(*reinterpret_cast< QString*>(_v)); break; + case 35: _t->setYMarginVertical(*reinterpret_cast< QString*>(_v)); break; + case 36: _t->setYMarginAll(*reinterpret_cast< QString*>(_v)); break; + case 37: _t->setYBorderTop(*reinterpret_cast< float*>(_v)); break; + case 38: _t->setYBorderRight(*reinterpret_cast< float*>(_v)); break; + case 39: _t->setYBorderBottom(*reinterpret_cast< float*>(_v)); break; + case 40: _t->setYBorderLeft(*reinterpret_cast< float*>(_v)); break; + case 41: _t->setYBorderHorizontal(*reinterpret_cast< float*>(_v)); break; + case 42: _t->setYBorderVertical(*reinterpret_cast< float*>(_v)); break; + case 43: _t->setYBorder(*reinterpret_cast< float*>(_v)); break; + default: break; + } + } else if (_c == QMetaObject::ResetProperty) { + } +#endif // QT_NO_PROPERTIES Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); @@ -90,6 +300,26 @@ void *NWidget::qt_metacast(const char *_clname) int NWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + +#ifndef QT_NO_PROPERTIES + if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty + || _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) { + qt_static_metacall(this, _c, _id, _a); + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyDesignable) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyScriptable) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyStored) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyEditable) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyUser) { + _id -= 44; + } +#endif // QT_NO_PROPERTIES return _id; } QT_WARNING_POP diff --git a/src/cpp/QtWidgets/QLabel/nlabel.h b/src/cpp/QtWidgets/QLabel/nlabel.h index 3a3198fa8..13bdef8bc 100644 --- a/src/cpp/QtWidgets/QLabel/nlabel.h +++ b/src/cpp/QtWidgets/QLabel/nlabel.h @@ -8,8 +8,8 @@ class NLabel: public QLabel, public YogaWidget { public: - using QLabel::QLabel; //inherit all constructors of QLabel SET_YOGA_WIDGET_Q_PROPERTIES + using QLabel::QLabel; //inherit all constructors of QLabel Q_OBJECT }; diff --git a/src/cpp/QtWidgets/QLabel/nlabel_moc.cpp b/src/cpp/QtWidgets/QLabel/nlabel_moc.cpp index 89a728820..6e9dc54e2 100644 --- a/src/cpp/QtWidgets/QLabel/nlabel_moc.cpp +++ b/src/cpp/QtWidgets/QLabel/nlabel_moc.cpp @@ -21,8 +21,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_NLabel_t { - QByteArrayData data[1]; - char stringdata0[7]; + QByteArrayData data[45]; + char stringdata0[484]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -31,10 +31,67 @@ struct qt_meta_stringdata_NLabel_t { ) static const qt_meta_stringdata_NLabel_t qt_meta_stringdata_NLabel = { { -QT_MOC_LITERAL(0, 0, 6) // "NLabel" +QT_MOC_LITERAL(0, 0, 6), // "NLabel" +QT_MOC_LITERAL(1, 7, 7), // "display" +QT_MOC_LITERAL(2, 15, 10), // "alignItems" +QT_MOC_LITERAL(3, 26, 12), // "alignContent" +QT_MOC_LITERAL(4, 39, 9), // "alignSelf" +QT_MOC_LITERAL(5, 49, 14), // "justifyContent" +QT_MOC_LITERAL(6, 64, 9), // "direction" +QT_MOC_LITERAL(7, 74, 13), // "flexDirection" +QT_MOC_LITERAL(8, 88, 8), // "overflow" +QT_MOC_LITERAL(9, 97, 8), // "position" +QT_MOC_LITERAL(10, 106, 8), // "flexWrap" +QT_MOC_LITERAL(11, 115, 4), // "flex" +QT_MOC_LITERAL(12, 120, 8), // "flexGrow" +QT_MOC_LITERAL(13, 129, 10), // "flexShrink" +QT_MOC_LITERAL(14, 140, 11), // "aspectRatio" +QT_MOC_LITERAL(15, 152, 3), // "top" +QT_MOC_LITERAL(16, 156, 5), // "right" +QT_MOC_LITERAL(17, 162, 6), // "bottom" +QT_MOC_LITERAL(18, 169, 4), // "left" +QT_MOC_LITERAL(19, 174, 9), // "flexBasis" +QT_MOC_LITERAL(20, 184, 8), // "minWidth" +QT_MOC_LITERAL(21, 193, 9), // "minHeight" +QT_MOC_LITERAL(22, 203, 8), // "maxWidth" +QT_MOC_LITERAL(23, 212, 9), // "maxHeight" +QT_MOC_LITERAL(24, 222, 10), // "paddingTop" +QT_MOC_LITERAL(25, 233, 12), // "paddingRight" +QT_MOC_LITERAL(26, 246, 13), // "paddingBottom" +QT_MOC_LITERAL(27, 260, 11), // "paddingLeft" +QT_MOC_LITERAL(28, 272, 17), // "paddingHorizontal" +QT_MOC_LITERAL(29, 290, 15), // "paddingVertical" +QT_MOC_LITERAL(30, 306, 7), // "padding" +QT_MOC_LITERAL(31, 314, 9), // "marginTop" +QT_MOC_LITERAL(32, 324, 11), // "marginRight" +QT_MOC_LITERAL(33, 336, 12), // "marginBottom" +QT_MOC_LITERAL(34, 349, 10), // "marginLeft" +QT_MOC_LITERAL(35, 360, 16), // "marginHorizontal" +QT_MOC_LITERAL(36, 377, 14), // "marginVertical" +QT_MOC_LITERAL(37, 392, 6), // "margin" +QT_MOC_LITERAL(38, 399, 9), // "borderTop" +QT_MOC_LITERAL(39, 409, 11), // "borderRight" +QT_MOC_LITERAL(40, 421, 12), // "borderBottom" +QT_MOC_LITERAL(41, 434, 10), // "borderLeft" +QT_MOC_LITERAL(42, 445, 16), // "borderHorizontal" +QT_MOC_LITERAL(43, 462, 14), // "borderVertical" +QT_MOC_LITERAL(44, 477, 6) // "border" }, - "NLabel" + "NLabel\0display\0alignItems\0alignContent\0" + "alignSelf\0justifyContent\0direction\0" + "flexDirection\0overflow\0position\0" + "flexWrap\0flex\0flexGrow\0flexShrink\0" + "aspectRatio\0top\0right\0bottom\0left\0" + "flexBasis\0minWidth\0minHeight\0maxWidth\0" + "maxHeight\0paddingTop\0paddingRight\0" + "paddingBottom\0paddingLeft\0paddingHorizontal\0" + "paddingVertical\0padding\0marginTop\0" + "marginRight\0marginBottom\0marginLeft\0" + "marginHorizontal\0marginVertical\0margin\0" + "borderTop\0borderRight\0borderBottom\0" + "borderLeft\0borderHorizontal\0borderVertical\0" + "border" }; #undef QT_MOC_LITERAL @@ -45,17 +102,170 @@ static const uint qt_meta_data_NLabel[] = { 0, // classname 0, 0, // classinfo 0, 0, // methods - 0, 0, // properties + 44, 14, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount + // properties: name, type, flags + 1, QMetaType::QString, 0x00095003, + 2, QMetaType::QString, 0x00095003, + 3, QMetaType::QString, 0x00095003, + 4, QMetaType::QString, 0x00095003, + 5, QMetaType::QString, 0x00095003, + 6, QMetaType::QString, 0x00095003, + 7, QMetaType::QString, 0x00095003, + 8, QMetaType::QString, 0x00095003, + 9, QMetaType::QString, 0x00095003, + 10, QMetaType::QString, 0x00095003, + 11, QMetaType::Float, 0x00095003, + 12, QMetaType::Float, 0x00095003, + 13, QMetaType::Float, 0x00095003, + 14, QMetaType::Float, 0x00095003, + 15, QMetaType::QString, 0x00095003, + 16, QMetaType::QString, 0x00095003, + 17, QMetaType::QString, 0x00095003, + 18, QMetaType::QString, 0x00095003, + 19, QMetaType::QString, 0x00095003, + 20, QMetaType::QString, 0x00095003, + 21, QMetaType::QString, 0x00095003, + 22, QMetaType::QString, 0x00095003, + 23, QMetaType::QString, 0x00095003, + 24, QMetaType::QString, 0x00095003, + 25, QMetaType::QString, 0x00095003, + 26, QMetaType::QString, 0x00095003, + 27, QMetaType::QString, 0x00095003, + 28, QMetaType::QString, 0x00095003, + 29, QMetaType::QString, 0x00095003, + 30, QMetaType::QString, 0x00095003, + 31, QMetaType::QString, 0x00095003, + 32, QMetaType::QString, 0x00095003, + 33, QMetaType::QString, 0x00095003, + 34, QMetaType::QString, 0x00095003, + 35, QMetaType::QString, 0x00095003, + 36, QMetaType::QString, 0x00095003, + 37, QMetaType::QString, 0x00095003, + 38, QMetaType::Float, 0x00095003, + 39, QMetaType::Float, 0x00095003, + 40, QMetaType::Float, 0x00095003, + 41, QMetaType::Float, 0x00095003, + 42, QMetaType::Float, 0x00095003, + 43, QMetaType::Float, 0x00095003, + 44, QMetaType::Float, 0x00095003, + 0 // eod }; void NLabel::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { + +#ifndef QT_NO_PROPERTIES + if (_c == QMetaObject::ReadProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: *reinterpret_cast< QString*>(_v) = _t->_yDisplay; break; + case 1: *reinterpret_cast< QString*>(_v) = _t->_yAlignItems; break; + case 2: *reinterpret_cast< QString*>(_v) = _t->_yAlignContent; break; + case 3: *reinterpret_cast< QString*>(_v) = _t->_yAlignSelf; break; + case 4: *reinterpret_cast< QString*>(_v) = _t->_yJustifyContent; break; + case 5: *reinterpret_cast< QString*>(_v) = _t->_yDirection; break; + case 6: *reinterpret_cast< QString*>(_v) = _t->_yFlexDirection; break; + case 7: *reinterpret_cast< QString*>(_v) = _t->_yOverflow; break; + case 8: *reinterpret_cast< QString*>(_v) = _t->_yPosition; break; + case 9: *reinterpret_cast< QString*>(_v) = _t->_yFlexWrap; break; + case 10: *reinterpret_cast< float*>(_v) = _t->_yFlex; break; + case 11: *reinterpret_cast< float*>(_v) = _t->_yFlexGrow; break; + case 12: *reinterpret_cast< float*>(_v) = _t->_yFlexShrink; break; + case 13: *reinterpret_cast< float*>(_v) = _t->_yAspectRatio; break; + case 14: *reinterpret_cast< QString*>(_v) = _t->_yTop; break; + case 15: *reinterpret_cast< QString*>(_v) = _t->_yRight; break; + case 16: *reinterpret_cast< QString*>(_v) = _t->_yBottom; break; + case 17: *reinterpret_cast< QString*>(_v) = _t->_yLeft; break; + case 18: *reinterpret_cast< QString*>(_v) = _t->_yFlexBasis; break; + case 19: *reinterpret_cast< QString*>(_v) = _t->_yMinWidth; break; + case 20: *reinterpret_cast< QString*>(_v) = _t->_yMinHeight; break; + case 21: *reinterpret_cast< QString*>(_v) = _t->_yMaxWidth; break; + case 22: *reinterpret_cast< QString*>(_v) = _t->_yMaxHeight; break; + case 23: *reinterpret_cast< QString*>(_v) = _t->_yPaddingTop; break; + case 24: *reinterpret_cast< QString*>(_v) = _t->_yPaddingRight; break; + case 25: *reinterpret_cast< QString*>(_v) = _t->_yPaddingBottom; break; + case 26: *reinterpret_cast< QString*>(_v) = _t->_yPaddingLeft; break; + case 27: *reinterpret_cast< QString*>(_v) = _t->_yPaddingHorizontal; break; + case 28: *reinterpret_cast< QString*>(_v) = _t->_yPaddingVertical; break; + case 29: *reinterpret_cast< QString*>(_v) = _t->_yPadding; break; + case 30: *reinterpret_cast< QString*>(_v) = _t->_yMarginTop; break; + case 31: *reinterpret_cast< QString*>(_v) = _t->_yMarginRight; break; + case 32: *reinterpret_cast< QString*>(_v) = _t->_yMarginBottom; break; + case 33: *reinterpret_cast< QString*>(_v) = _t->_yMarginLeft; break; + case 34: *reinterpret_cast< QString*>(_v) = _t->_yMarginHorizontal; break; + case 35: *reinterpret_cast< QString*>(_v) = _t->_yMarginVertical; break; + case 36: *reinterpret_cast< QString*>(_v) = _t->_yMargin; break; + case 37: *reinterpret_cast< float*>(_v) = _t->_yBorderTop; break; + case 38: *reinterpret_cast< float*>(_v) = _t->_yBorderRight; break; + case 39: *reinterpret_cast< float*>(_v) = _t->_yBorderBottom; break; + case 40: *reinterpret_cast< float*>(_v) = _t->_yBorderLeft; break; + case 41: *reinterpret_cast< float*>(_v) = _t->_yBorderHorizontal; break; + case 42: *reinterpret_cast< float*>(_v) = _t->_yBorderVertical; break; + case 43: *reinterpret_cast< float*>(_v) = _t->_yBorder; break; + default: break; + } + } else if (_c == QMetaObject::WriteProperty) { + auto *_t = static_cast(_o); + Q_UNUSED(_t) + void *_v = _a[0]; + switch (_id) { + case 0: _t->setYDisplay(*reinterpret_cast< QString*>(_v)); break; + case 1: _t->setYAlignItems(*reinterpret_cast< QString*>(_v)); break; + case 2: _t->setYAlignContent(*reinterpret_cast< QString*>(_v)); break; + case 3: _t->setYAlignSelf(*reinterpret_cast< QString*>(_v)); break; + case 4: _t->setYJustifyContent(*reinterpret_cast< QString*>(_v)); break; + case 5: _t->setYDirection(*reinterpret_cast< QString*>(_v)); break; + case 6: _t->setYFlexDirection(*reinterpret_cast< QString*>(_v)); break; + case 7: _t->setYOverflow(*reinterpret_cast< QString*>(_v)); break; + case 8: _t->setYPosition(*reinterpret_cast< QString*>(_v)); break; + case 9: _t->setYFlexWrap(*reinterpret_cast< QString*>(_v)); break; + case 10: _t->setYFlex(*reinterpret_cast< float*>(_v)); break; + case 11: _t->setYFlexGrow(*reinterpret_cast< float*>(_v)); break; + case 12: _t->setYFlexShrink(*reinterpret_cast< float*>(_v)); break; + case 13: _t->setYAspectRatio(*reinterpret_cast< float*>(_v)); break; + case 14: _t->setYNodeTop(*reinterpret_cast< QString*>(_v)); break; + case 15: _t->setYNodeRight(*reinterpret_cast< QString*>(_v)); break; + case 16: _t->setYNodeBottom(*reinterpret_cast< QString*>(_v)); break; + case 17: _t->setYNodeLeft(*reinterpret_cast< QString*>(_v)); break; + case 18: _t->setYFlexBasis(*reinterpret_cast< QString*>(_v)); break; + case 19: _t->setYMinWidth(*reinterpret_cast< QString*>(_v)); break; + case 20: _t->setYMinHeight(*reinterpret_cast< QString*>(_v)); break; + case 21: _t->setYMaxWidth(*reinterpret_cast< QString*>(_v)); break; + case 22: _t->setYMaxHeight(*reinterpret_cast< QString*>(_v)); break; + case 23: _t->setYPaddingTop(*reinterpret_cast< QString*>(_v)); break; + case 24: _t->setYPaddingRight(*reinterpret_cast< QString*>(_v)); break; + case 25: _t->setYPaddingBottom(*reinterpret_cast< QString*>(_v)); break; + case 26: _t->setYPaddingLeft(*reinterpret_cast< QString*>(_v)); break; + case 27: _t->setYPaddingHorizontal(*reinterpret_cast< QString*>(_v)); break; + case 28: _t->setYPaddingVertical(*reinterpret_cast< QString*>(_v)); break; + case 29: _t->setYPadding(*reinterpret_cast< QString*>(_v)); break; + case 30: _t->setYMarginTop(*reinterpret_cast< QString*>(_v)); break; + case 31: _t->setYMarginRight(*reinterpret_cast< QString*>(_v)); break; + case 32: _t->setYMarginBottom(*reinterpret_cast< QString*>(_v)); break; + case 33: _t->setYMarginLeft(*reinterpret_cast< QString*>(_v)); break; + case 34: _t->setYMarginHorizontal(*reinterpret_cast< QString*>(_v)); break; + case 35: _t->setYMarginVertical(*reinterpret_cast< QString*>(_v)); break; + case 36: _t->setYMarginAll(*reinterpret_cast< QString*>(_v)); break; + case 37: _t->setYBorderTop(*reinterpret_cast< float*>(_v)); break; + case 38: _t->setYBorderRight(*reinterpret_cast< float*>(_v)); break; + case 39: _t->setYBorderBottom(*reinterpret_cast< float*>(_v)); break; + case 40: _t->setYBorderLeft(*reinterpret_cast< float*>(_v)); break; + case 41: _t->setYBorderHorizontal(*reinterpret_cast< float*>(_v)); break; + case 42: _t->setYBorderVertical(*reinterpret_cast< float*>(_v)); break; + case 43: _t->setYBorder(*reinterpret_cast< float*>(_v)); break; + default: break; + } + } else if (_c == QMetaObject::ResetProperty) { + } +#endif // QT_NO_PROPERTIES Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); @@ -90,6 +300,26 @@ void *NLabel::qt_metacast(const char *_clname) int NLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QLabel::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + +#ifndef QT_NO_PROPERTIES + if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty + || _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) { + qt_static_metacall(this, _c, _id, _a); + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyDesignable) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyScriptable) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyStored) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyEditable) { + _id -= 44; + } else if (_c == QMetaObject::QueryPropertyUser) { + _id -= 44; + } +#endif // QT_NO_PROPERTIES return _id; } QT_WARNING_POP diff --git a/src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp b/src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp index 2495d86f1..b6cd589c7 100644 --- a/src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp +++ b/src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp @@ -4,7 +4,6 @@ #include "src/cpp/core/FlexLayout/flexnode_wrap.h" #include - Napi::FunctionReference QLabelWrap::constructor; Napi::Object QLabelWrap::init(Napi::Env env, Napi::Object exports) { diff --git a/src/cpp/core/YogaWidget/yogawidget.cpp b/src/cpp/core/YogaWidget/yogawidget.cpp index 1ef458fb7..c0612120e 100644 --- a/src/cpp/core/YogaWidget/yogawidget.cpp +++ b/src/cpp/core/YogaWidget/yogawidget.cpp @@ -7,8 +7,8 @@ void YogaWidget::setYDisplay(QString display){ YGNodeStyleSetDisplay(this->getFlexNode(),static_cast(value)); this->_yDisplay = display; qDebug()<<"Value set display "<getFlexNode(),static_cast(value)); this->_yAlignItems = alignItems; qDebug()<<"Value set alignItems "<getFlexNode(),static_cast(value)); this->_yAlignContent = alignContent; qDebug()<<"Value set alignContent "<getFlexNode(),static_cast(value)); this->_yAlignSelf = alignSelf; qDebug()<<"Value set alignSelf "<getFlexNode(),static_cast(value)); this->_yJustifyContent = justifyContent; qDebug()<<"Value set justifyContent "<getFlexNode(),static_cast(value)); this->_yDirection = direction; qDebug()<<"Value set direction "<getFlexNode(),static_cast(value)); this->_yFlexDirection = flexDirection; qDebug()<<"Value set flexDirection "<getFlexNode(),static_cast(value)); this->_yOverflow = overflow; qDebug()<<"Value set overflow "<getFlexNode(),static_cast(value)); this->_yPosition = position; qDebug()<<"Value set positionType "<getFlexNode(),static_cast(value)); this->_yFlexWrap = flexWrap; qDebug()<<"Value set flexWrap "<getFlexNode(),flex); this->_yFlex = flex; qDebug()<<"Value set flex "<getFlexNode(),flexGrow); this->_yFlexGrow = flexGrow; qDebug()<<"Value set flexGrow "<getFlexNode(),flexShrink); this->_yFlexShrink = flexShrink; qDebug()<<"Value set flexShrink "<getFlexNode(),aspectRatio); this->_yAspectRatio = aspectRatio; qDebug()<<"Value set aspectRatio "<getFlexNode(), YGEdgeTop,measurement.value) : YGNodeStyleSetPosition(this->getFlexNode(),YGEdgeTop,measurement.value); this->_yTop = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: top: "<getFlexNode(), YGEdgeRight,measurement.value) : YGNodeStyleSetPosition(this->getFlexNode(),YGEdgeRight,measurement.value); this->_yRight = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: right: "<getFlexNode(), YGEdgeBottom,measurement.value) : YGNodeStyleSetPosition(this->getFlexNode(),YGEdgeBottom,measurement.value); this->_yBottom = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: bottom: "<getFlexNode(), YGEdgeLeft,measurement.value) : YGNodeStyleSetPosition(this->getFlexNode(),YGEdgeLeft,measurement.value); this->_yLeft = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: left: "<getFlexNode(),measurement.value); } this->_yFlexBasis = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: flexBasis: "<getFlexNode(), measurement.value) : YGNodeStyleSetMinWidth(this->getFlexNode(), measurement.value); this->_yMinWidth = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: minWidth: "<getFlexNode(), measurement.value) : YGNodeStyleSetMinHeight(this->getFlexNode(), measurement.value); this->_yMinHeight = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: minHeight: "<getFlexNode(), measurement.value) : YGNodeStyleSetMaxWidth(this->getFlexNode(), measurement.value); this->_yMaxWidth = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: maxWidth: "<getFlexNode(), measurement.value) : YGNodeStyleSetMaxHeight(this->getFlexNode(), measurement.value); this->_yMaxHeight = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: maxHeight: "<getFlexNode(),YGEdgeTop, measurement.value) : YGNodeStyleSetPadding(this->getFlexNode(),YGEdgeTop, measurement.value); this->_yPaddingTop = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: paddingTop: "<getFlexNode(),YGEdgeRight, measurement.value) : YGNodeStyleSetPadding(this->getFlexNode(),YGEdgeRight, measurement.value); this->_yPaddingRight = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: paddingRight: "<getFlexNode(),YGEdgeBottom, measurement.value) : YGNodeStyleSetPadding(this->getFlexNode(),YGEdgeBottom, measurement.value); this->_yPaddingBottom = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: paddingBottom: "<getFlexNode(),YGEdgeLeft, measurement.value) : YGNodeStyleSetPadding(this->getFlexNode(), YGEdgeLeft, measurement.value); this->_yPaddingLeft = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: paddingLeft: "<getFlexNode(), YGEdgeHorizontal, measurement.value) : YGNodeStyleSetPadding(this->getFlexNode(),YGEdgeHorizontal, measurement.value); this->_yPaddingHorizontal = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: paddingHorizontal: "<getFlexNode(),YGEdgeVertical, measurement.value) : YGNodeStyleSetPadding(this->getFlexNode(),YGEdgeVertical, measurement.value); this->_yPaddingVertical = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: paddingVertical: "<getFlexNode(),YGEdgeAll, measurement.value) : YGNodeStyleSetPadding(this->getFlexNode(),YGEdgeAll, measurement.value); this->_yPadding = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: padding: "<getFlexNode(),YGEdgeTop, measurement.value) : YGNodeStyleSetMargin(this->getFlexNode(),YGEdgeTop, measurement.value); this->_yMarginTop = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: marginTop: "<getFlexNode(),YGEdgeRight, measurement.value) : YGNodeStyleSetMargin(this->getFlexNode(),YGEdgeRight, measurement.value); this->_yMarginRight = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: marginRight: "<getFlexNode(),YGEdgeBottom, measurement.value) : YGNodeStyleSetMargin(this->getFlexNode(),YGEdgeBottom, measurement.value); this->_yMarginBottom = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: marginBottom: "<getFlexNode(),YGEdgeLeft, measurement.value) : YGNodeStyleSetMargin(this->getFlexNode(), YGEdgeLeft, measurement.value); this->_yMarginLeft = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: marginLeft: "<getFlexNode(), YGEdgeHorizontal, measurement.value) : YGNodeStyleSetMargin(this->getFlexNode(),YGEdgeHorizontal, measurement.value); this->_yMarginHorizontal = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: marginHorizontal: "<getFlexNode(),YGEdgeVertical, measurement.value) : YGNodeStyleSetMargin(this->getFlexNode(),YGEdgeVertical, measurement.value); this->_yMarginVertical = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: marginVertical: "<getFlexNode(),YGEdgeAll, measurement.value) : YGNodeStyleSetMargin(this->getFlexNode(),YGEdgeAll, measurement.value); this->_yMargin = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: margin: "<getFlexNode(),YGEdgeTop, rawValue); this->_yBorderTop = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: borderTop: "<getFlexNode(),YGEdgeRight, rawValue); this->_yBorderRight = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: borderRight: "<getFlexNode(),YGEdgeBottom, rawValue); this->_yBorderBottom = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: borderBottom: "<getFlexNode(), YGEdgeLeft, rawValue); this->_yBorderLeft = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: borderLeft: "<getFlexNode(),YGEdgeHorizontal, rawValue); this->_yBorderHorizontal = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: borderHorizontal: "<getFlexNode(),YGEdgeVertical, rawValue); this->_yBorderVertical = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: borderVertical: "<getFlexNode(), YGEdgeAll, rawValue); this->_yBorder = rawValue; - }catch(std::exception &e){ - qDebug()<<"Error: border: "<