Qt 4.8
Public Functions | Public Variables | List of all members
QDeclarativeLoaderPrivate Class Reference

#include <qdeclarativeloader_p_p.h>

Inheritance diagram for QDeclarativeLoaderPrivate:
QDeclarativeImplicitSizeItemPrivate QDeclarativeItemChangeListener QDeclarativeItemPrivate QGraphicsItemPrivate

Public Functions

void _q_sourceLoaded ()
 
void _q_updateSize (bool loaderGeometryChanged=true)
 
void clear ()
 
void initResize ()
 
void itemGeometryChanged (QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry)
 
void load ()
 
 QDeclarativeLoaderPrivate ()
 
 ~QDeclarativeLoaderPrivate ()
 
- Public Functions inherited from QDeclarativeImplicitSizeItemPrivate
virtual void implicitHeightChanged ()
 
virtual void implicitWidthChanged ()
 
 QDeclarativeImplicitSizeItemPrivate ()
 
- Public Functions inherited from QDeclarativeItemPrivate
QDeclarativeStateGroup_states ()
 
void addItemChangeListener (QDeclarativeItemChangeListener *listener, ChangeTypes types)
 
AnchorLinesanchorLines () const
 
QDeclarativeAnchorsanchors ()
 
QDeclarativeAnchorLine baseline () const
 
QDeclarativeAnchorLine bottom () const
 
QPointF computeTransformOrigin () const
 
QDeclarativeListProperty< QObjectdata ()
 
virtual void focusChanged (bool)
 
virtual void focusScopeItemChange (bool isSubFocusItem)
 Subclasses can reimplement this function to be notified when an item becomes a focusScopeItem (or is no longer a focusScopeItem). More...
 
qreal height () const
 
QDeclarativeAnchorLine horizontalCenter () const
 
virtual qreal implicitHeight () const
 
virtual qreal implicitWidth () const
 
void init (QDeclarativeItem *parent)
 
bool isMirrored () const
 
QDeclarativeAnchorLine left () const
 
virtual void mirrorChange ()
 
 QDeclarativeItemPrivate ()
 
void removeItemChangeListener (QDeclarativeItemChangeListener *, ChangeTypes types)
 
void resetHeight ()
 
void resetWidth ()
 
void resolveLayoutMirror ()
 
QDeclarativeListProperty< QObjectresources ()
 
QDeclarativeAnchorLine right () const
 
void setHeight (qreal)
 
void setImplicitLayoutMirror (bool mirror, bool inherit)
 
void setLayoutMirror (bool mirror)
 
virtual void setPosHelper (const QPointF &pos)
 Sets the position pos. More...
 
void setState (const QString &)
 
void setWidth (qreal)
 
virtual void siblingOrderChange ()
 Subclasses can reimplement this function to be notified when its siblingIndex order is changed. More...
 
QString state () const
 
QDeclarativeListProperty< QDeclarativeStatestates ()
 
QDeclarativeAnchorLine top () const
 
virtual void transformChanged ()
 
QDeclarativeListProperty< QDeclarativeTransitiontransitions ()
 
QDeclarativeAnchorLine verticalCenter () const
 
qreal width () const
 
- Public Functions inherited from QGraphicsItemPrivate
void addChild (QGraphicsItem *child)
 QGraphicsScenePrivate::registerTopLevelItem(). More...
 
void appendGraphicsTransform (QGraphicsTransform *t)
 
qreal calcEffectiveOpacity () const
 
void childrenBoundingRectHelper (QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
 Returns the bounding rect of this item's children (excluding itself). More...
 
bool childrenClippedToShape () const
 
bool childrenCombineOpacity () const
 
QDeclarativeListProperty< QGraphicsObjectchildrenList ()
 Returns a list of this item's children. More...
 
void clearFocusHelper (bool giveFocusToParent)
 
void clearSubFocus (QGraphicsItem *rootItem=0, QGraphicsItem *stopItem=0)
 
qreal combineOpacityFromParent (qreal parentOpacity) const
 
void combineTransformFromParent (QTransform *x, const QTransform *viewTransform=0) const
 Combines this item's position and transform onto transform. More...
 
void combineTransformToParent (QTransform *x, const QTransform *viewTransform=0) const
 Combines this item's position and transform onto transform. More...
 
int depth () const
 
bool discardUpdateRequest (bool ignoreVisibleBit=false, bool ignoreDirtyBit=false, bool ignoreOpacity=false) const
 Returns true if we can discard an update request; otherwise false. More...
 
QRectF effectiveBoundingRect (QGraphicsItem *topMostEffectItem=0) const
 Returns the effective bounding rect of the item. More...
 
QRectF effectiveBoundingRect (const QRectF &rect) const
 Returns the effective bounding rect of the given item space rect. More...
 
qreal effectiveOpacity () const
 
void ensureSceneTransform ()
 
void ensureSceneTransformRecursive (QGraphicsItem **topMostDirtyItem)
 
void ensureSequentialSiblingIndex ()
 Ensures that the list of children is sorted by insertion order, and that the siblingIndexes are packed (no gaps), and start at 0. More...
 
void ensureSortedChildren ()
 
QVariant extra (Extra type) const
 
QGraphicsItemCacheextraItemCache () const
 
QPointF genericMapFromScene (const QPointF &pos, const QWidget *viewport) const
 Maps the point pos from scene to item coordinates. More...
 
bool hasTranslateOnlySceneTransform ()
 
void initStyleOption (QStyleOptionGraphicsItem *option, const QTransform &worldTransform, const QRegion &exposedRegion, bool allItems=false) const
 
virtual QVariant inputMethodQueryHelper (Qt::InputMethodQuery query) const
 This helper function helped us add input method query support in Qt 4. More...
 
void invalidateChildGraphicsEffectsRecursively (InvalidateReason reason)
 
void invalidateChildrenSceneTransform ()
 
void invalidateDepthRecursively ()
 
void invalidateParentGraphicsEffectsRecursively ()
 
bool isFullyTransparent () const
 
bool isInvisible () const
 
bool isOpacityNull () const
 
virtual bool isProxyWidget () const
 
bool itemIsUntransformable () const
 
void markParentDirty (bool updateBoundingRect=false)
 
QGraphicsItemCachemaybeExtraItemCache () const
 
void prependGraphicsTransform (QGraphicsTransform *t)
 
 QGraphicsItemPrivate ()
 
void remapItemPos (QEvent *event, QGraphicsItem *item)
 Maps any item pos properties of event to item's coordinate system. More...
 
void removeChild (QGraphicsItem *child)
 QGraphicsScenePrivate::unregisterTopLevelItem(). More...
 
void removeExtraItemCache ()
 
void resetFocusProxy ()
 Sets the focusProxy pointer to 0 for all items that have this item as their focusProxy. More...
 
void resolveDepth ()
 Resolves the stacking depth of this object and all its ancestors. More...
 
virtual void resolveFont (uint inheritedMask)
 
virtual void resolvePalette (uint inheritedMask)
 
QRectF sceneEffectiveBoundingRect () const
 Returns the effective bounding rect of this item in scene coordinates, by combining sceneTransform() with boundingRect(), taking into account the effect that the item might have. More...
 
void sendScenePosChange ()
 
void setEnabledHelper (bool newEnabled, bool explicitly, bool update=true)
 Sets this item's visibility to newEnabled. More...
 
void setExtra (Extra type, const QVariant &value)
 
void setFocusHelper (Qt::FocusReason focusReason, bool climb, bool focusFromHide)
 
void setIsMemberOfGroup (bool enabled)
 Propagates item group membership. More...
 
void setParentItemHelper (QGraphicsItem *parent, const QVariant *newParentVariant, const QVariant *thisPointerVariant)
 Make sure not to trigger any pure virtual function calls (e. More...
 
void setSubFocus (QGraphicsItem *rootItem=0, QGraphicsItem *stopItem=0)
 
void setTransformHelper (const QTransform &transform)
 Sets the transform transform. More...
 
void setVisibleHelper (bool newVisible, bool explicitly, bool update=true)
 Sets this item's visibility to newVisible. More...
 
virtual void subFocusItemChange ()
 Subclasses can reimplement this function to be notified when subFocusItem changes. More...
 
QTransform transformToParent () const
 
void unsetExtra (Extra type)
 
void updateAncestorFlag (QGraphicsItem::GraphicsItemFlag childFlag, AncestorFlag flag=NoFlag, bool enabled=false, bool root=true)
 Propagates the ancestor flag flag with value enabled to all this item's children. More...
 
void updateAncestorFlags ()
 
void updateChildWithGraphicsEffectFlagRecursively ()
 
void updatePaintedViewBoundingRects (bool updateChildren)
 
virtual void updateSceneTransformFromParent ()
 
virtual ~QGraphicsItemPrivate ()
 
- Public Functions inherited from QDeclarativeItemChangeListener
virtual QDeclarativeAnchorsPrivateanchorPrivate ()
 
virtual void itemDestroyed (QDeclarativeItem *)
 
virtual void itemOpacityChanged (QDeclarativeItem *)
 
virtual void itemSiblingOrderChanged (QDeclarativeItem *)
 
virtual void itemVisibilityChanged (QDeclarativeItem *)
 

Public Variables

QDeclarativeComponentcomponent
 
QGraphicsObjectitem
 
bool itemHeightValid: 1
 
bool itemWidthValid: 1
 
bool ownComponent: 1
 
QUrl source
 
bool updatingSize: 1
 
- Public Variables inherited from QDeclarativeItemPrivate
AnchorLines_anchorLines
 
QDeclarativeAnchors_anchors
 
QDeclarativeContents_contents
 
QDeclarativeStateGroup_stateGroup
 
QDeclarativeLayoutMirroringAttachedattachedLayoutDirection
 
QDeclarativeNullableValue< qrealbaselineOffset
 
QPODVector< ChangeListener, 4 > changeListeners
 
bool componentComplete:1
 
bool doneEventPreHandler: 1
 
bool effectiveLayoutMirror:1
 
bool hadActiveFocus:1
 
bool hadFocus:1
 
bool heightValid:1
 
bool inheritedLayoutMirror:1
 
bool inheritMirrorFromItem:1
 
bool inheritMirrorFromParent:1
 
bool isMirrorImplicit:1
 
bool keepMouse:1
 
QDeclarativeItemKeyFilterkeyHandler
 
qreal mHeight
 
qreal mImplicitHeight
 
qreal mImplicitWidth
 
qreal mWidth
 
QDeclarativeItem::TransformOrigin origin:5
 
QDeclarativeNotifier parentNotifier
 
bool smooth:1
 
bool transformOriginDirty: 1
 
bool widthValid:1
 
- Public Variables inherited from QGraphicsItemPrivate
quint32 acceptDrops: 1
 
quint32 acceptedMouseButtons: 5
 
quint32 acceptedTouchBeginEvent: 1
 
quint32 acceptsHover: 1
 
quint32 acceptTouchEvents: 1
 
quint32 allChildrenDirty: 1
 
quint32 ancestorFlags: 4
 
quint32 cacheMode: 2
 
QList< QGraphicsItem * > children
 
QRectF childrenBoundingRect
 
quint32 dirty: 1
 
quint32 dirtyChildren: 1
 
quint32 dirtyChildrenBoundingRect: 1
 
quint32 dirtySceneTransform: 1
 
quint32 enabled: 1
 
quint32 explicitActivate: 1
 
quint32 explicitlyDisabled: 1
 
quint32 explicitlyHidden: 1
 
QList< ExtraStructextras
 
quint32 filtersDescendantEvents: 1
 
quint32 flags: 19
 
QGraphicsItemfocusProxy
 
QList< QGraphicsItem ** > focusProxyRefs
 
QGraphicsItemfocusScopeItem
 
quint32 fullUpdatePending: 1
 
quint32 geometryChanged: 1
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
int globalStackingOrder
 
QGraphicsEffectgraphicsEffect
 
quint32 handlesChildEvents: 1
 
quint32 hasBoundingRegionGranularity: 1
 
quint32 hasCursor: 1
 
quint32 holesInSiblingIndex: 1
 
quint32 ignoreOpacity: 1
 
quint32 ignoreVisible: 1
 
Qt::InputMethodHints imHints
 
quint32 inDestructor: 1
 
int index
 
quint32 inSetPosHelper: 1
 
quint32 isDeclarativeItem: 1
 
quint32 isMemberOfGroup: 1
 
quint32 isObject: 1
 
quint32 isWidget: 1
 
int itemDepth
 
quint32 itemDiscovered: 1
 
quint32 localCollisionHack: 1
 
quint32 mayHaveChildWithGraphicsEffect: 1
 
quint32 mouseSetsFocus: 1
 
quint32 needSortChildren: 1
 
QRectF needsRepaint
 
quint32 notifyBoundingRectChanged: 1
 
quint32 notifyInvalidated: 1
 
qreal opacity
 
quint32 padding: 21
 
QMap< QWidget *, QRectpaintedViewBoundingRects
 
quint32 paintedViewBoundingRectsNeedRepaint: 1
 
QGraphicsItem::PanelModality panelModality
 
QGraphicsItemparent
 
quint32 pendingPolish: 1
 
QPointF pos
 
QGraphicsItemq_ptr
 
QGraphicsScenescene
 
quint32 scenePosDescendants: 1
 
QTransform sceneTransform
 
quint32 sceneTransformTranslateOnly: 1
 
quint32 selected: 1
 
quint32 sendParentChangeNotification: 1
 
quint32 sequentialOrdering: 1
 
int siblingIndex
 
QGraphicsItemsubFocusItem
 
TransformDatatransformData
 
quint32 updateDueToGraphicsEffect: 1
 
quint32 visible: 1
 
quint32 wantsActive: 1
 
qreal z
 

Additional Inherited Members

- Public Types inherited from QDeclarativeItemPrivate
enum  ChangeType {
  Geometry = 0x01, SiblingOrder = 0x02, Visibility = 0x04, Opacity = 0x08,
  Destroyed = 0x10
}
 
- Public Types inherited from QGraphicsItemPrivate
enum  AncestorFlag {
  NoFlag = 0, AncestorHandlesChildEvents = 0x1, AncestorClipsChildren = 0x2, AncestorIgnoresTransformations = 0x4,
  AncestorFiltersChildEvents = 0x8
}
 
enum  Extra {
  ExtraToolTip, ExtraCursor, ExtraCacheData, ExtraMaxDeviceCoordCacheSize,
  ExtraBoundingRegionGranularity
}
 
enum  InvalidateReason { OpacityChanged }
 
- Static Public Functions inherited from QDeclarativeItemPrivate
static void data_append (QDeclarativeListProperty< QObject > *, QObject *)
 
static QObjectdata_at (QDeclarativeListProperty< QObject > *, int)
 
static void data_clear (QDeclarativeListProperty< QObject > *)
 
static int data_count (QDeclarativeListProperty< QObject > *)
 
static qint64 elapsed (QElapsedTimer &)
 
static QDeclarativeItemPrivateget (QDeclarativeItem *item)
 
static void parentProperty (QObject *o, void *rv, QDeclarativeNotifierEndpoint *e)
 
static void resources_append (QDeclarativeListProperty< QObject > *, QObject *)
 
static QObjectresources_at (QDeclarativeListProperty< QObject > *, int)
 
static void resources_clear (QDeclarativeListProperty< QObject > *)
 
static int resources_count (QDeclarativeListProperty< QObject > *)
 
static qint64 restart (QElapsedTimer &)
 
static void setConsistentTime (qint64 t)
 
static void start (QElapsedTimer &)
 
static void transform_append (QDeclarativeListProperty< QGraphicsTransform > *list, QGraphicsTransform *)
 
static QGraphicsTransformtransform_at (QDeclarativeListProperty< QGraphicsTransform > *list, int)
 
static void transform_clear (QDeclarativeListProperty< QGraphicsTransform > *list)
 
static int transform_count (QDeclarativeListProperty< QGraphicsTransform > *list)
 
- Static Public Functions inherited from QGraphicsItemPrivate
static void children_append (QDeclarativeListProperty< QGraphicsObject > *list, QGraphicsObject *item)
 
static QGraphicsObjectchildren_at (QDeclarativeListProperty< QGraphicsObject > *list, int)
 
static void children_clear (QDeclarativeListProperty< QGraphicsObject > *list)
 
static int children_count (QDeclarativeListProperty< QGraphicsObject > *list)
 
static const QGraphicsItemPrivateget (const QGraphicsItem *item)
 
static QGraphicsItemPrivateget (QGraphicsItem *item)
 
static bool insertionOrder (QGraphicsItem *a, QGraphicsItem *b)
 
static bool isOpacityNull (qreal opacity)
 
static bool movableAncestorIsSelected (const QGraphicsItem *item)
 
- Static Public Variables inherited from QDeclarativeItemPrivate
static qint64 consistentTime = -1
 

Detailed Description

Definition at line 64 of file qdeclarativeloader_p_p.h.

Constructors and Destructors

◆ QDeclarativeLoaderPrivate()

QDeclarativeLoaderPrivate::QDeclarativeLoaderPrivate ( )

◆ ~QDeclarativeLoaderPrivate()

QDeclarativeLoaderPrivate::~QDeclarativeLoaderPrivate ( )

Definition at line 56 of file qdeclarativeloader.cpp.

57 {
58 }

Functions

◆ _q_sourceLoaded()

void QDeclarativeLoaderPrivate::_q_sourceLoaded ( )

Definition at line 377 of file qdeclarativeloader.cpp.

378 {
380 
381  if (component) {
382  if (!component->errors().isEmpty()) {
384  emit q->sourceChanged();
385  emit q->statusChanged();
386  emit q->progressChanged();
387  return;
388  }
389 
390  QDeclarativeContext *creationContext = component->creationContext();
391  if (!creationContext) creationContext = qmlContext(q);
392  QDeclarativeContext *ctxt = new QDeclarativeContext(creationContext);
393  ctxt->setContextObject(q);
394 
396  QObject *obj = component->beginCreate(ctxt);
397  if (component != c) {
398  // component->create could trigger a change in source that causes
399  // component to be set to something else. In that case we just
400  // need to cleanup.
401  if (c)
402  c->completeCreate();
403  delete obj;
404  delete ctxt;
405  return;
406  }
407  if (obj) {
409  if (item) {
412  item->setParentItem(q);
413 // item->setFocus(true);
414  initResize();
415  } else {
416  qmlInfo(q) << QDeclarativeLoader::tr("Loader does not support loading non-visual elements.");
417  delete obj;
418  delete ctxt;
419  }
420  } else {
421  if (!component->errors().isEmpty())
423  delete obj;
424  delete ctxt;
425  source = QUrl();
426  }
428  emit q->sourceChanged();
429  emit q->statusChanged();
430  emit q->progressChanged();
431  emit q->itemChanged();
432  emit q->loaded();
433  }
434 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
unsigned char c[8]
Definition: qnumeric_p.h:62
void setParentItem(QGraphicsItem *parent)
Sets this item&#39;s parent item to newParent.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
void setContextObject(QObject *)
Set the context object.
QList< QDeclarativeError > errors() const
Return the list of errors that occurred during the last compile or create operation.
QDeclarativeComponent * component
#define emit
Definition: qobjectdefs.h:76
virtual QObject * beginCreate(QDeclarativeContext *)
This method provides more advanced control over component instance creation.
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
The QDeclarativeContext class defines a context within a QML engine.
QDeclarativeInfo qmlInfo(const QObject *me)
The QGraphicsObject class provides a base class for all graphics items that require signals...
void warning(const QDeclarativeError &)
virtual void completeCreate()
This method provides more advanced control over component instance creation.
QDeclarativeContext * creationContext() const
Returns the QDeclarativeContext the component was created in.

◆ _q_updateSize()

void QDeclarativeLoaderPrivate::_q_updateSize ( bool  loaderGeometryChanged = true)

Definition at line 534 of file qdeclarativeloader.cpp.

Referenced by initResize(), and itemGeometryChanged().

535 {
537  if (!item || updatingSize)
538  return;
539 
540  updatingSize = true;
541  if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
542  if (!itemWidthValid)
543  q->setImplicitWidth(qmlItem->implicitWidth());
544  else
545  q->setImplicitWidth(qmlItem->width());
546  if (loaderGeometryChanged && q->widthValid())
547  qmlItem->setWidth(q->width());
548  if (!itemHeightValid)
549  q->setImplicitHeight(qmlItem->implicitHeight());
550  else
551  q->setImplicitHeight(qmlItem->height());
552  if (loaderGeometryChanged && q->heightValid())
553  qmlItem->setHeight(q->height());
554  } else if (item && item->isWidget()) {
555  QGraphicsWidget *widget = static_cast<QGraphicsWidget*>(item);
556  QSizeF widgetSize = widget->size();
557  q->setImplicitWidth(widgetSize.width());
558  if (loaderGeometryChanged && q->widthValid())
559  widgetSize.setWidth(q->width());
560  q->setImplicitHeight(widgetSize.height());
561  if (loaderGeometryChanged && q->heightValid())
562  widgetSize.setHeight(q->height());
563  if (widget->size() != widgetSize)
564  widget->resize(widgetSize);
565  }
566  updatingSize = false;
567 }
QPointer< QWidget > widget
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
void setWidth(qreal w)
Sets the width to the given width.
Definition: qsize.h:290
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
#define Q_Q(Class)
Definition: qglobal.h:2483
The QDeclarativeItem class provides the most basic of all visual items in QML.
bool isWidget() const
Returns true if this item is a widget (i.
void setHeight(qreal h)
Sets the height to the given height.
Definition: qsize.h:293
QSizeF size
the size of the widget
void resize(const QSizeF &size)
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

◆ clear()

void QDeclarativeLoaderPrivate::clear ( )

Definition at line 72 of file qdeclarativeloader.cpp.

73 {
74  if (ownComponent) {
76  component = 0;
77  ownComponent = false;
78  }
79  source = QUrl();
80 
81  if (item) {
82  if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
84  static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
86  }
87 
88  // We can't delete immediately because our item may have triggered
89  // the Loader to load a different item.
90  if (item->scene()) {
92  } else {
93  item->setParentItem(0);
94  item->setVisible(false);
95  }
96  item->deleteLater();
97  item = 0;
98  }
99 }
void setParentItem(QGraphicsItem *parent)
Sets this item&#39;s parent item to newParent.
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
void setVisible(bool visible)
If visible is true, the item is made visible.
The QDeclarativeItem class provides the most basic of all visual items in QML.
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
QDeclarativeComponent * component
void removeItemChangeListener(QDeclarativeItemChangeListener *, ChangeTypes types)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
void deleteLater()
Schedules this object for deletion.
Definition: qobject.cpp:2145

◆ initResize()

void QDeclarativeLoaderPrivate::initResize ( )

Definition at line 101 of file qdeclarativeloader.cpp.

102 {
104  if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
106  static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
108  // We may override the item's size, so we need to remember
109  // whether the item provided its own valid size.
112  } else if (item && item->isWidget()) {
113  QGraphicsWidget *widget = static_cast<QGraphicsWidget*>(item);
114  widget->installEventFilter(q);
115  }
116  _q_updateSize();
117 }
QPointer< QWidget > widget
#define Q_Q(Class)
Definition: qglobal.h:2483
The QDeclarativeItem class provides the most basic of all visual items in QML.
void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
void _q_updateSize(bool loaderGeometryChanged=true)
void installEventFilter(QObject *)
Installs an event filter filterObj on this object.
Definition: qobject.cpp:2070
bool isWidget() const
Returns true if this item is a widget (i.
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

◆ itemGeometryChanged()

void QDeclarativeLoaderPrivate::itemGeometryChanged ( QDeclarativeItem item,
const QRectF newGeometry,
const QRectF oldGeometry 
)
virtual

Reimplemented from QDeclarativeItemChangeListener.

Definition at line 60 of file qdeclarativeloader.cpp.

61 {
62  if (resizeItem == item) {
63  if (!updatingSize && newGeometry.width() != oldGeometry.width())
64  itemWidthValid = true;
65  if (!updatingSize && newGeometry.height() != oldGeometry.height())
66  itemHeightValid = true;
67  _q_updateSize(false);
68  }
69  QDeclarativeItemChangeListener::itemGeometryChanged(resizeItem, newGeometry, oldGeometry);
70 }
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
virtual void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &)
void _q_updateSize(bool loaderGeometryChanged=true)

◆ load()

void QDeclarativeLoaderPrivate::load ( )

Definition at line 356 of file qdeclarativeloader.cpp.

357 {
359 
360  if (!q->isComponentComplete() || !component)
361  return;
362 
363  if (!component->isLoading()) {
364  _q_sourceLoaded();
365  } else {
367  q, SLOT(_q_sourceLoaded()));
368  QObject::connect(component, SIGNAL(progressChanged(qreal)),
369  q, SIGNAL(progressChanged()));
370  emit q->statusChanged();
371  emit q->progressChanged();
372  emit q->sourceChanged();
373  emit q->itemChanged();
374  }
375 }
Status
Emitted after component "startup" has completed.
double qreal
Definition: qglobal.h:1193
#define SLOT(a)
Definition: qobjectdefs.h:226
#define Q_Q(Class)
Definition: qglobal.h:2483
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
QDeclarativeComponent * component
#define emit
Definition: qobjectdefs.h:76
bool isLoading() const
Returns true if status() == QDeclarativeComponent::Loading.

Properties

◆ component

QDeclarativeComponent* QDeclarativeLoaderPrivate::component

Definition at line 79 of file qdeclarativeloader_p_p.h.

Referenced by clear().

◆ item

QGraphicsObject* QDeclarativeLoaderPrivate::item

Definition at line 78 of file qdeclarativeloader_p_p.h.

Referenced by clear(), initResize(), and itemGeometryChanged().

◆ itemHeightValid

bool QDeclarativeLoaderPrivate::itemHeightValid

Definition at line 83 of file qdeclarativeloader_p_p.h.

Referenced by initResize(), and itemGeometryChanged().

◆ itemWidthValid

bool QDeclarativeLoaderPrivate::itemWidthValid

Definition at line 82 of file qdeclarativeloader_p_p.h.

Referenced by initResize(), and itemGeometryChanged().

◆ ownComponent

bool QDeclarativeLoaderPrivate::ownComponent

Definition at line 80 of file qdeclarativeloader_p_p.h.

Referenced by clear().

◆ source

QUrl QDeclarativeLoaderPrivate::source

Definition at line 77 of file qdeclarativeloader_p_p.h.

Referenced by clear().

◆ updatingSize

bool QDeclarativeLoaderPrivate::updatingSize

Definition at line 81 of file qdeclarativeloader_p_p.h.

Referenced by itemGeometryChanged().


The documentation for this class was generated from the following files: