1// qquickitem.sip generated by MetaSIP 2// 3// This file is part of the QtQuick Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QQuickItem : QObject, QQmlParserStatus /ExportDerived/ 24{ 25%TypeHeaderCode 26#include <qquickitem.h> 27%End 28 29public: 30 enum Flag 31 { 32 ItemClipsChildrenToShape, 33 ItemAcceptsInputMethod, 34 ItemIsFocusScope, 35 ItemHasContents, 36 ItemAcceptsDrops, 37 }; 38 39 typedef QFlags<QQuickItem::Flag> Flags; 40 41 enum ItemChange 42 { 43 ItemChildAddedChange, 44 ItemChildRemovedChange, 45 ItemSceneChange, 46 ItemVisibleHasChanged, 47 ItemParentHasChanged, 48 ItemOpacityHasChanged, 49 ItemActiveFocusHasChanged, 50 ItemRotationHasChanged, 51%If (Qt_5_3_0 -) 52 ItemAntialiasingHasChanged, 53%End 54%If (Qt_5_6_0 -) 55 ItemDevicePixelRatioHasChanged, 56%End 57%If (Qt_5_10_0 -) 58 ItemEnabledHasChanged, 59%End 60 }; 61 62 struct ItemChangeData 63 { 64%TypeHeaderCode 65#include <qquickitem.h> 66%End 67 68 ItemChangeData(QQuickItem *v); 69 ItemChangeData(QQuickWindow *v); 70 ItemChangeData(qreal v /Constrained/); 71 ItemChangeData(bool v /Constrained/); 72 QQuickItem *item; 73 QQuickWindow *window; 74 qreal realValue; 75 bool boolValue; 76 }; 77 78 enum TransformOrigin 79 { 80 TopLeft, 81 Top, 82 TopRight, 83 Left, 84 Center, 85 Right, 86 BottomLeft, 87 Bottom, 88 BottomRight, 89 }; 90 91%If (Qt_5_6_1 -) 92 explicit QQuickItem(QQuickItem *parent /TransferThis/ = 0); 93%End 94%If (- Qt_5_6_1) 95 QQuickItem(QQuickItem *parent /TransferThis/ = 0); 96%End 97 virtual ~QQuickItem(); 98 QQuickWindow *window() const; 99 QQuickItem *parentItem() const; 100 void setParentItem(QQuickItem *parent); 101 void stackBefore(const QQuickItem *); 102 void stackAfter(const QQuickItem *); 103 QRectF childrenRect(); 104 QList<QQuickItem *> childItems() const; 105 bool clip() const; 106 void setClip(bool); 107 QString state() const; 108 void setState(const QString &); 109 qreal baselineOffset() const; 110 void setBaselineOffset(qreal); 111 qreal x() const; 112 qreal y() const; 113 void setX(qreal); 114 void setY(qreal); 115 qreal width() const; 116 void setWidth(qreal); 117 void resetWidth(); 118 void setImplicitWidth(qreal); 119 qreal implicitWidth() const; 120 qreal height() const; 121 void setHeight(qreal); 122 void resetHeight(); 123 void setImplicitHeight(qreal); 124 qreal implicitHeight() const; 125 QQuickItem::TransformOrigin transformOrigin() const; 126 void setTransformOrigin(QQuickItem::TransformOrigin); 127 qreal z() const; 128 void setZ(qreal); 129 qreal rotation() const; 130 void setRotation(qreal); 131 qreal scale() const; 132 void setScale(qreal); 133 qreal opacity() const; 134 void setOpacity(qreal); 135 bool isVisible() const; 136 void setVisible(bool); 137 bool isEnabled() const; 138 void setEnabled(bool); 139 bool smooth() const; 140 void setSmooth(bool); 141 bool antialiasing() const; 142 void setAntialiasing(bool); 143 QQuickItem::Flags flags() const; 144 void setFlag(QQuickItem::Flag flag, bool enabled = true); 145 void setFlags(QQuickItem::Flags flags); 146 bool hasActiveFocus() const; 147 bool hasFocus() const; 148 void setFocus(bool); 149 bool isFocusScope() const; 150 QQuickItem *scopedFocusItem() const; 151 Qt::MouseButtons acceptedMouseButtons() const; 152 void setAcceptedMouseButtons(Qt::MouseButtons buttons); 153 bool acceptHoverEvents() const; 154 void setAcceptHoverEvents(bool enabled); 155 QCursor cursor() const; 156 void setCursor(const QCursor &cursor); 157 void unsetCursor(); 158 void grabMouse(); 159 void ungrabMouse(); 160 bool keepMouseGrab() const; 161 void setKeepMouseGrab(bool); 162 bool filtersChildMouseEvents() const; 163 void setFiltersChildMouseEvents(bool filter); 164 void grabTouchPoints(const QVector<int> &ids); 165 void ungrabTouchPoints(); 166 bool keepTouchGrab() const; 167 void setKeepTouchGrab(bool); 168 virtual bool contains(const QPointF &point) const; 169 QPointF mapToItem(const QQuickItem *item, const QPointF &point) const; 170 QPointF mapToScene(const QPointF &point) const; 171 QRectF mapRectToItem(const QQuickItem *item, const QRectF &rect) const; 172 QRectF mapRectToScene(const QRectF &rect) const; 173 QPointF mapFromItem(const QQuickItem *item, const QPointF &point) const; 174 QPointF mapFromScene(const QPointF &point) const; 175 QRectF mapRectFromItem(const QQuickItem *item, const QRectF &rect) const; 176 QRectF mapRectFromScene(const QRectF &rect) const; 177 void polish(); 178 void forceActiveFocus(); 179 QQuickItem *childAt(qreal x, qreal y) const; 180 virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const; 181 182 struct UpdatePaintNodeData 183 { 184%TypeHeaderCode 185#include <qquickitem.h> 186%End 187 188 QSGTransformNode *transformNode; 189 190 private: 191 UpdatePaintNodeData(); 192 }; 193 194 virtual bool isTextureProvider() const; 195 virtual QSGTextureProvider *textureProvider() const; 196 197public slots: 198 void update() /ReleaseGIL/; 199 200protected: 201 virtual bool event(QEvent *); 202 bool isComponentComplete() const; 203 virtual void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &); 204 void updateInputMethod(Qt::InputMethodQueries queries = Qt::InputMethodQuery::ImQueryInput); 205 bool widthValid() const; 206 bool heightValid() const; 207 virtual void classBegin(); 208 virtual void componentComplete(); 209 virtual void keyPressEvent(QKeyEvent *event); 210 virtual void keyReleaseEvent(QKeyEvent *event); 211 virtual void inputMethodEvent(QInputMethodEvent *); 212 virtual void focusInEvent(QFocusEvent *); 213 virtual void focusOutEvent(QFocusEvent *); 214 virtual void mousePressEvent(QMouseEvent *event); 215 virtual void mouseMoveEvent(QMouseEvent *event); 216 virtual void mouseReleaseEvent(QMouseEvent *event); 217 virtual void mouseDoubleClickEvent(QMouseEvent *event); 218 virtual void mouseUngrabEvent(); 219 virtual void touchUngrabEvent(); 220 virtual void wheelEvent(QWheelEvent *event); 221 virtual void touchEvent(QTouchEvent *event); 222 virtual void hoverEnterEvent(QHoverEvent *event); 223 virtual void hoverMoveEvent(QHoverEvent *event); 224 virtual void hoverLeaveEvent(QHoverEvent *event); 225 virtual void dragEnterEvent(QDragEnterEvent *); 226 virtual void dragMoveEvent(QDragMoveEvent *); 227 virtual void dragLeaveEvent(QDragLeaveEvent *); 228 virtual void dropEvent(QDropEvent *); 229 virtual bool childMouseEventFilter(QQuickItem *, QEvent *); 230 virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); 231 virtual QSGNode *updatePaintNode(QSGNode *, QQuickItem::UpdatePaintNodeData *); 232%VirtualCatcherCode 233 PyObject *res; 234 235 res = sipCallMethod(&sipIsErr, sipMethod, "DD", 236 a0, sipType_QSGNode, NULL, 237 a1, sipType_QQuickItem_UpdatePaintNodeData, NULL); 238 239 if (res) 240 { 241 sipParseResult(&sipIsErr, sipMethod, res, "H0", sipType_QSGNode, &sipRes); 242 243 if (!sipIsErr && sipRes && (sipRes->flags() & QSGNode::OwnedByParent)) 244 sipTransferTo(res, (PyObject *)sipPySelf); 245 246 Py_DECREF(res); 247 } 248%End 249 250 virtual void releaseResources(); 251 virtual void updatePolish(); 252 253public: 254%If (Qt_5_1_0 -) 255 bool activeFocusOnTab() const; 256%End 257%If (Qt_5_1_0 -) 258 void setActiveFocusOnTab(bool); 259%End 260%If (Qt_5_1_0 -) 261 void setFocus(bool focus, Qt::FocusReason reason); 262%End 263%If (Qt_5_1_0 -) 264 void forceActiveFocus(Qt::FocusReason reason); 265%End 266%If (Qt_5_1_0 -) 267 QQuickItem *nextItemInFocusChain(bool forward = true); 268%End 269 270signals: 271%If (Qt_5_1_0 -) 272 void windowChanged(QQuickWindow *window); 273%End 274 275public: 276%If (Qt_5_3_0 -) 277 void resetAntialiasing(); 278%End 279%If (Qt_5_4_0 -) 280 QQuickItemGrabResult *grabToImage(const QSize &targetSize = QSize()) /Factory/; 281%MethodCode 282 QSharedPointer<QQuickItemGrabResult> *grab; 283 284 Py_BEGIN_ALLOW_THREADS 285 // This will leak but there seems to be no way to detach the object. 286 grab = new QSharedPointer<QQuickItemGrabResult>(sipCpp->grabToImage(*a0)); 287 Py_END_ALLOW_THREADS 288 289 sipRes = grab->data(); 290%End 291 292%End 293%If (Qt_5_7_0 -) 294 bool isAncestorOf(const QQuickItem *child) const; 295%End 296%If (Qt_5_7_0 -) 297 QPointF mapToGlobal(const QPointF &point) const; 298%End 299%If (Qt_5_7_0 -) 300 QPointF mapFromGlobal(const QPointF &point) const; 301%End 302%If (Qt_5_10_0 -) 303 QSizeF size() const; 304%End 305%If (Qt_5_10_0 -) 306 bool acceptTouchEvents() const; 307%End 308%If (Qt_5_10_0 -) 309 void setAcceptTouchEvents(bool accept); 310%End 311%If (Qt_5_11_0 -) 312 QObject *containmentMask() const; 313%End 314%If (Qt_5_11_0 -) 315 void setContainmentMask(QObject *mask /KeepReference/); 316%End 317 318signals: 319%If (Qt_5_11_0 -) 320 void containmentMaskChanged(); 321%End 322}; 323 324QFlags<QQuickItem::Flag> operator|(QQuickItem::Flag f1, QFlags<QQuickItem::Flag> f2); 325