5#include <private/qquickitem_p.h>
7#if QT_CONFIG(quick_shadereffect)
8#include <QtQuick/private/qquickshadereffectsource_p.h>
10#include <QtQuick/private/qquickrectangle_p.h>
11#include <QtQml/private/qabstractanimationjob_p.h>
12#include <private/qqmlengine_p.h>
13#include <private/qquickview_p.h>
14#include <QtQuick/private/qquickstategroup_p.h>
15#include <QtGui/QImage>
16#include <private/qqmlvme_p.h>
17#include <private/qqmlcomponentattached_p.h>
18#include <private/qqmldata_p.h>
19#include <private/qsgadaptationlayer_p.h>
31 for (ItemTextureHashIt iterator = m_itemTextureHash.
begin(),
end = m_itemTextureHash.
end(); iterator !=
end; ++iterator) {
41 if (referencedItem ==
nullptr)
49 if (!m_itemTextureHash.
contains(referencedItem)) {
53 QSizeF itemSize = referencedItem->size();
68 if (referencedItem ==
nullptr)
71 delete m_itemTextureHash.
take(referencedItem);
77 if (referencedItem ==
nullptr || referencedItem->parentItem() ==
nullptr) {
78 qDebug() << __FILE__ << __LINE__ <<
"Warning: Item can be rendered.";
82 QSGLayer *renderTexture = m_itemTextureHash.
value(referencedItem);
85 if (renderTexture ==
nullptr)
90 renderTexture->markDirtyTexture();
91 renderTexture->updateTexture();
93 QImage renderImage = renderTexture->toImage();
94 renderImage = renderImage.
mirrored(
false,
true);
96 if (renderImage.size().isEmpty())
97 qDebug() << __FILE__ << __LINE__ <<
"Warning: Image is empty.";
104 if (referencedItem ==
nullptr)
112 if (referencedItem ==
nullptr)
120 if (referencedItem ==
nullptr)
129 if (referencedItem ==
nullptr)
137 if (referencedItem ==
nullptr)
149 switch (anchorLine) {
174 return anchorNameList.contains(
name);
194 const auto childItems = fromItem->childItems();
291 QObject *targetObject =
nullptr;
301 return QPair<QString, QObject*>();
305 targetObject = anchorLine.
item;
311 return QPair<QString, QObject*>(targetName, targetObject);
345 while (componentAttached) {
346 if (componentAttached->
parent())
347 if (componentAttached->
parent() ==
object)
350 componentAttached = componentAttached->
next();
357 QList<QObject*> objectList;
360 objectList.reserve(stateList.size());
362 objectList.append(
state);
ComponentCompleteDisabler()
~ComponentCompleteDisabler()
QGraphicsWidget * window() const
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
T value(const Key &key) const noexcept
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QImage mirrored(bool horizontally=false, bool vertically=true) const &
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore\reentrant
QQmlComponentAttached * next() const
static QQmlRefPointer< QQmlContextData > get(QQmlContext *context)
The QQmlContext class defines a context within a QML engine.
static QQmlData * get(QObjectPrivate *priv, bool create)
static void activateDesignerMode()
The QQmlProperty class abstracts accessing properties on objects created from QML.
bool isValid() const
Returns true if the QQmlProperty refers to a valid property, otherwise false.
QVariant read() const
Returns the property value.
static void disableComponentComplete()
static void enableComponentComplete()
QQuickAnchors::Anchor anchorLine
void resetVerticalCenter()
QQuickAnchorLine horizontalCenter
Anchors usedAnchors() const
QQuickAnchorLine baseline
QQuickAnchorLine verticalCenter
void resetHorizontalCenter()
static QTransform parentTransform(QQuickItem *referencedItem)
static QPair< QString, QObject * > anchorLineTarget(QQuickItem *item, const QString &name, QQmlContext *context)
void refFromEffectItem(QQuickItem *referencedItem, bool hide=true)
static QTransform windowTransform(QQuickItem *referencedItem)
static void enableComponentComplete()
static bool hasAnchor(QQuickItem *item, const QString &name)
static bool isDirty(QQuickItem *referencedItem, DirtyType dirtyType)
static bool isValidHeight(QQuickItem *item)
static void emitComponentCompleteSignalForAttachedProperty(QObject *item)
static void updateDirtyNode(QQuickItem *item)
static void polishItems(QQuickWindow *window)
static bool isComponentComplete(QQuickItem *item)
static void resetDirty(QQuickItem *referencedItem)
QImage renderImageForItem(QQuickItem *referencedItem, const QRectF &boundingRect, const QSize &imageSize)
static void activateDesignerMode()
static void disableComponentComplete()
static QQuickItem * anchorFillTargetItem(QQuickItem *item)
static void setRootItem(QQuickView *view, QQuickItem *item)
static void addDirty(QQuickItem *referencedItem, DirtyType dirtyType)
static bool isValidWidth(QQuickItem *item)
static bool isAnchoredTo(QQuickItem *fromItem, QQuickItem *toItem)
static bool areChildrenAnchoredTo(QQuickItem *fromItem, QQuickItem *toItem)
static QQuickItem * anchorCenterInTargetItem(QQuickItem *item)
static void refreshExpressions(QQmlContext *context)
static void resetAnchor(QQuickItem *item, const QString &name)
static QList< QObject * > statesForItem(QQuickItem *item)
static int borderWidth(QQuickItem *item)
void derefFromEffectItem(QQuickItem *referencedItem, bool unhide=true)
QQuickAnchors * anchors() const
\qmlpropertygroup QtQuick::Item::anchors \qmlproperty AnchorLine QtQuick::Item::anchors....
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QQuickPen * border
\qmlproperty bool QtQuick::Rectangle::antialiasing
static QQuickViewPrivate * get(QQuickView *view)
The QQuickView class provides a window for displaying a Qt Quick user interface.
static QQuickWindowPrivate * get(QQuickWindow *c)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtCore\reentrant
virtual QSGLayer * createLayer(QSGRenderContext *renderContext)=0
QSGContext * sceneGraphContext() const
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
static const QRectF boundingRect(const QPointF *points, int pointCount)
QString propertyNameForAnchorLine(const QQuickAnchors::Anchor &anchorLine)
bool isValidAnchorName(const QString &name)
QQuickAnchors * anchors(QQuickItem *item)
QQuickAnchors::Anchor anchorLineFlagForName(const QString &name)
#define Q_ASSERT_X(cond, x, msg)
QLatin1StringView QLatin1String