Qt 4.8
Functions
qgraphicslayout_p.cpp File Reference
#include "qglobal.h"
#include "qgraphicslayout_p.h"
#include "qgraphicslayout.h"
#include "qgraphicswidget.h"
#include "qapplication.h"

Go to the source code of this file.

Functions

static bool removeLayoutItemFromLayout (QGraphicsLayout *lay, QGraphicsLayoutItem *layoutItem)
 

Function Documentation

◆ removeLayoutItemFromLayout()

static bool removeLayoutItemFromLayout ( QGraphicsLayout lay,
QGraphicsLayoutItem layoutItem 
)
static

Definition at line 118 of file qgraphicslayout_p.cpp.

Referenced by QGraphicsLayoutPrivate::addChildLayoutItem().

119 {
120  if (!lay)
121  return false;
122 
123  for (int i = lay->count() - 1; i >= 0; --i) {
124  QGraphicsLayoutItem *child = lay->itemAt(i);
125  if (child && child->isLayout()) {
126  if (removeLayoutItemFromLayout(static_cast<QGraphicsLayout*>(child), layoutItem))
127  return true;
128  } else if (child == layoutItem) {
129  lay->removeAt(i);
130  return true;
131  }
132  }
133  return false;
134 }
virtual void removeAt(int index)=0
This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to remove the item ...
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts...
bool isLayout() const
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges o...
virtual int count() const =0
This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to return the numbe...
virtual QGraphicsLayoutItem * itemAt(int i) const =0
This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to return a pointer...
static bool removeLayoutItemFromLayout(QGraphicsLayout *lay, QGraphicsLayoutItem *layoutItem)