358 const int topOffset = 0;
359 const int bottomOffset = 50;
360 const int leftOffset = 0;
361 const int rightOffset = 100;
367 #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) 369 if (qobject_cast<QMacStyle *>(widgets.
at(0)->style()))
373 const int dy =
qMax(titleBarHeight - (titleBarHeight - fontMetrics.
height()) / 2, 1);
375 const int n = widgets.
size();
376 const int nrows =
qMax((domain.
height() - (topOffset + bottomOffset)) / dy, 1);
377 const int ncols =
qMax(n / nrows + ((n % nrows) ? 1 : 0), 1);
378 const int dcol = (domain.
width() - (leftOffset + rightOffset)) / ncols;
381 for (
int row = 0; row < nrows; ++row) {
382 for (
int col = 0; col < ncols; ++col) {
383 const int x = leftOffset + row * dx + col * dcol;
384 const int y = topOffset + row * dy;
The QFontMetrics class provides font metrics information.
QPointer< QWidget > widget
The QStyleOptionTitleBar class is used to describe the parameters for drawing a title bar...
int width() const
Returns the width of the rectangle.
int height() const
Returns the height of the rectangle.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
static QFont font()
Returns the default application font.
static bool sanityCheck(const QMdiSubWindow *const child, const char *where)
void initFrom(const QWidget *w)
const T & at(int i) const
Returns the item at index position i in the list.
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction...
The QPoint class defines a point in the plane using integer precision.
int size() const
Returns the number of items in the list.
The QRect class defines a rectangle in the plane using integer precision.
int height() const
Returns the height of the font.