119 int x = effectiveRect.x();
120 int y = effectiveRect.y();
124 QWidget *wid = item->widget();
127 spaceX = wid->style()->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal);
130 spaceY = wid->style()->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Vertical);
131 QSize size = item->sizeHint();
133 if (size.height() <= 28)
135 lineHeight = size.height() / 2;
137 lineHeight = qMax(lineHeight, size.height());
139 int nextX = x + size.width() + spaceX;
140 if (nextX - spaceX > effectiveRect.right()) {
141 x = effectiveRect.x();
142 y = y + lineHeight + spaceY;
143 nextX = x + size.width() + spaceX;
147 item->setGeometry(QRect(QPoint(x, y), size));
151 return y + lineHeight - rect.y() +
bottom;