44 #ifndef QT_NO_GRAPHICSVIEW 167 if (parent && !parent->
isLayout()) {
170 if (itemParent && itemParent->
isWidget()) {
171 static_cast<QGraphicsWidget *
>(itemParent)->d_func()->setLayout_helper(
this);
173 qWarning(
"QGraphicsLayout::QGraphicsLayout: Attempt to create a layout with a parent that is" 174 " neither a QGraphicsWidget nor QGraphicsLayout");
188 if (parent && !parent->
isLayout()) {
191 if (itemParent && itemParent->
isWidget()) {
192 static_cast<QGraphicsWidget *
>(itemParent)->d_func()->setLayout_helper(
this);
194 qWarning(
"QGraphicsLayout::QGraphicsLayout: Attempt to create a layout with a parent that is" 195 " neither a QGraphicsWidget nor QGraphicsLayout");
225 if (
d->left == left &&
d->top == top &&
d->right == right &&
d->bottom == bottom)
268 d->activateRecursive(
this);
273 while (parentItem && parentItem->
isLayout())
313 while (layoutItem && layoutItem->
isLayout()) {
317 layoutItem->d_func()->sizeHintCacheDirty =
true;
318 layoutItem->d_func()->sizeHintWithConstraintCacheDirty =
true;
322 layoutItem->d_func()->sizeHintCacheDirty =
true;
323 layoutItem->d_func()->sizeHintWithConstraintCacheDirty =
true;
326 bool postIt = layoutItem ? !layoutItem->
isLayout() :
false;
329 while (layoutItem && layoutItem->
isLayout()
331 static_cast<QGraphicsLayout*
>(layoutItem)->d_func()->activated =
false;
334 if (layoutItem && !layoutItem->
isLayout()) {
349 d->activated =
false;
357 static_cast<QGraphicsLayout *>(parentItem)->invalidate();
363 if (parentItem->isLayout()) {
364 parentItem->updateGeometry();
479 d->addChildLayoutItem(layoutItem);
526 #endif //QT_NO_GRAPHICSVIEW
virtual void setGeometry(const QRectF &rect)
This virtual function sets the geometry of the QGraphicsLayoutItem to rect, which is in parent coordi...
#define QT_END_NAMESPACE
This macro expands to.
void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const
Reimplemented Function
virtual void updateGeometry()
Reimplemented Function
QGraphicsLayout(QGraphicsLayoutItem *parent=0)
Contructs a QGraphicsLayout object.
QGraphicsItem * graphicsItem() const
Returns the QGraphicsItem that this layout item represents.
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
QRectF contentsRect() const
Returns the contents rect in local coordinates.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
void setParentLayoutItem(QGraphicsLayoutItem *parent)
Sets the parent of this QGraphicsLayoutItem to parent.
static bool g_instantInvalidatePropagation
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
virtual void invalidate()
Clears any cached geometry and size hint information in the layout, and posts a LayoutRequest event t...
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void updateGeometry()
This virtual function discards any cached size hint information.
Q_CORE_EXPORT void qWarning(const char *,...)
virtual void widgetEvent(QEvent *e)
This virtual event handler receives all events for the managed widget.
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts...
static bool instantInvalidatePropagation()
bool isActivated() const
Returns true if the layout is currently being activated; otherwise, returns false.
bool isLayout() const
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges o...
void setOwnedByLayout(bool ownedByLayout)
Sets whether a layout should delete this item in its destructor or not.
QGraphicsLayoutItem * parentLayoutItem() const
Returns the parent of this QGraphicsLayoutItem, or 0 if there is no parent, or if the parent does not...
~QGraphicsLayout()
Destroys the QGraphicsLayout object.
void addChildLayoutItem(QGraphicsLayoutItem *layoutItem)
This function is a convenience function provided for custom layouts, and will go through all items in...
The QGraphicsLayout class provides the base class for all layouts in Graphics View.
bool isWidget() const
Returns true if this item is a widget (i.
void activate()
Activates the layout, causing all items in the layout to be immediately rearranged.
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)
Sets the contents margins to left, top, right and bottom.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
static void setInstantInvalidatePropagation(bool enable)