125 #include <QtCore/qdebug.h>
207 for (
int i =
count() - 1;
i >= 0; --
i) {
214 item->setParentLayoutItem(
nullptr);
215 if (
item->ownedByLayout())
231 d->engine.transpose();
244 return d->orientation;
271 qWarning(
"QGraphicsLinearLayout::insertItem: cannot insert null item");
275 qWarning(
"QGraphicsLinearLayout::insertItem: cannot insert itself");
278 d->addChildLayoutItem(
item);
282 d->engine.insertRow(
index,
d->orientation);
284 d->engine.insertItem(gridEngineItem,
index);
298 d->engine.insertRow(
index,
d->orientation);
299 d->engine.setRowStretchFactor(
index, stretch,
d->orientation);
313 item->setParentLayoutItem(
nullptr);
314 d->removeGridItem(gridItem);
330 qWarning(
"QGraphicsLinearLayout::removeAt: invalid index %d",
index);
336 layoutItem->setParentLayoutItem(
nullptr);
337 d->removeGridItem(gridItem);
353 qWarning(
"QGraphicsLinearLayout::setSpacing: invalid spacing %g",
spacing);
369 return d->engine.spacing(
d->orientation,
d->styleInfo());
387 return d->engine.rowSpacing(
index,
d->orientation);
403 qWarning(
"QGraphicsLinearLayout::setStretchFactor: cannot assign"
404 " a stretch factor to a null item");
409 d->engine.setStretchFactor(
item, stretch,
d->orientation);
423 qWarning(
"QGraphicsLinearLayout::setStretchFactor: cannot return"
424 " a stretch factor for a null item");
427 return d->engine.stretchFactor(
item,
d->orientation);
458 return d->engine.alignment(
item);
462 QSizePolicy::ControlTypes QGraphicsLinearLayout::controlTypes(
LayoutSide side)
const
464 return d->engine.controlTypes(side);
474 return d->engine.itemCount();
485 qWarning(
"QGraphicsLinearLayout::itemAt: invalid index %d",
index);
490 item = gridItem->layoutItem();
505 d->engine.setVisualDirection(visualDir);
509 #ifdef QGRIDLAYOUTENGINE_DEBUG
510 if (qt_graphicsLayoutDebug()) {
516 d->engine.setGeometries(effectiveRect,
d->styleInfo());
517 #ifdef QGRIDLAYOUTENGINE_DEBUG
518 if (qt_graphicsLayoutDebug()) {
534 return d->engine.sizeHint(which , constraint - extraMargins,
d->styleInfo()) + extraMargins;
543 d->engine.invalidate();
545 d->m_styleInfo->invalidate();
554 #ifdef QGRIDLAYOUTENGINE_DEBUG
555 if (qt_graphicsLayoutDebug()) {
557 qDebug(
"%*s%s layout", indent,
"",
559 d->engine.dump(indent + 1);
small capitals from c petite p scientific i
[1]
The QGraphicsLayout class provides the base class for all layouts in Graphics View.
virtual void invalidate()
void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts.
virtual void setGeometry(const QRectF &rect)
The QGraphicsLinearLayout class provides a horizontal or vertical layout for managing widgets in Grap...
void removeItem(QGraphicsLayoutItem *item)
Qt::Alignment alignment(QGraphicsLayoutItem *item) const
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
void setStretchFactor(QGraphicsLayoutItem *item, int stretch)
void setItemSpacing(int index, qreal spacing)
void setOrientation(Qt::Orientation orientation)
void setSpacing(qreal spacing)
void removeAt(int index) override
QGraphicsLinearLayout(QGraphicsLayoutItem *parent=nullptr)
void setGeometry(const QRectF &rect) override
void insertStretch(int index, int stretch=1)
int stretchFactor(QGraphicsLayoutItem *item) const
virtual ~QGraphicsLinearLayout()
void invalidate() override
qreal itemSpacing(int index) const
void insertItem(int index, QGraphicsLayoutItem *item)
void setAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment)
void dump(int indent=0) const
QGraphicsLayoutItem * itemAt(int index) const override
Qt::Orientation orientation() const
int count() const override
QGraphicsLinearLayoutPrivate(Qt::Orientation orientation)
QScopedPointer< QGraphicsLayoutStyleInfo > m_styleInfo
Qt::Orientation orientation
void fixIndex(int *index) const
int gridRow(int index) const
void removeGridItem(QGridLayoutItem *gridItem)
QGraphicsLayoutStyleInfo * styleInfo() const
int gridColumn(int index) const
QGraphicsGridLayoutEngine engine
void removeItem(QGridLayoutItem *item)
int columnCount(Qt::Orientation orientation) const
void removeRows(int row, int count, Qt::Orientation orientation)
int rowCount(Qt::Orientation orientation) const
The QRectF class defines a finite rectangle in the plane using floating point precision.
constexpr void adjust(qreal x1, qreal y1, qreal x2, qreal y2) noexcept
T * data() const noexcept
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
The QSizeF class defines the size of a two-dimensional object using floating point precision.
union Alignment_ Alignment
QT_END_INCLUDE_NAMESPACE typedef double qreal
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent