本文整理汇总了C++中QLayoutItem::minimumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QLayoutItem::minimumSize方法的具体用法?C++ QLayoutItem::minimumSize怎么用?C++ QLayoutItem::minimumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLayoutItem
的用法示例。
在下文中一共展示了QLayoutItem::minimumSize方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: minimumSize
QSize QLayoutItemProto::minimumSize() const
{
QLayoutItem *item = qscriptvalue_cast<QLayoutItem*>(thisObject());
if (item)
return item->minimumSize();
return QSize();
}
示例2: minimumSize
QSize FlowLayout::minimumSize() const {
QSize size;
QLayoutItem *item;
foreach (item, itemList)
size = size.expandedTo(item->minimumSize());
size += QSize(2*margin(), 2*margin());
return size;
}
示例3: minimumSize
QSize StatusBarLayout::minimumSize() const
{
QSize s(0, 0);
for (int i = 0; i < m_items.size(); ++i) {
QLayoutItem* item = m_items.at(i);
s = s.expandedTo(item->minimumSize());
}
return s;
}
示例4: minimumSize
QSize SimpleFlow::minimumSize() const
{
QSize s(0,0);
QPtrListIterator<QLayoutItem> it(list);
QLayoutItem *o;
while ( (o=it.current()) != 0 ) {
++it;
s = s.expandedTo( o->minimumSize() );
}
return s;
}
示例5: minimumSize
QSize CardLayout::minimumSize() const
{
QSize s(0,0);
int n = list.count();
int i = 0;
while (i < n) {
QLayoutItem *o = list.at(i);
s = s.expandedTo(o->minimumSize());
++i;
}
return s + n*QSize(spacing(), spacing());
}
示例6: minimumSize
QSize MonitorLayout::minimumSize() const
{
QSize size;
QLayoutItem* item;
foreach (item, m_items)
size = size.expandedTo(item->minimumSize());
size += QSize(2 * margin(), 2 * margin());
return size;
}
示例7: minimumSize
QSize FlowLayout::minimumSize() const
{
QSize size;
QLayoutItem *item;
Q_FOREACH ( item, itemList )
size = size.expandedTo ( item->minimumSize() );
int left, top, right, bottom;
getContentsMargins ( &left, &top, &right, &bottom );
size += QSize ( left + right, top + bottom );
return size;
}
示例8: minimumSize
QSize OverlayLayout::minimumSize() const
{
QSize s(0,0);
int n = list.count();
int i = 0;
while (i < n) {
QLayoutItem *o = list.at(i);
s = s.expandedTo(o->minimumSize());
++i;
}
return s;
}
示例9: minimumSize
QSize FlowLayout::minimumSize() const
{
QSize size;
QLayoutItem *item;
foreach (item, itemList)
size = size.expandedTo(item->minimumSize());
int left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
const int margin = left;
size += QSize(2*margin, 2*margin);
return size;
}
示例10: doLayout
int GroupFlowLayout::doLayout(const QRect &rect, bool testOnly) const
{
int left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
QRect effectiveRect = rect.adjusted(+left, +top, -right, -bottom);
int x = effectiveRect.x();
int y = effectiveRect.y();
int lineHeight = 0;
QLayoutItem *item;
foreach (item, itemList) {
QWidget *wid = item->widget();
int spaceX = horizontalSpacing();
if (wid && spaceX == -1)
spaceX = wid->style()->layoutSpacing(
QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal);
if (spaceX == -1) spaceX = 5;
int spaceY = verticalSpacing();
if (wid && spaceY == -1)
spaceY = wid->style()->layoutSpacing(
QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Vertical);
if (spaceY == -1) spaceX = 5;
int nextX = x + item->sizeHint().width() + spaceX;
if (nextX - spaceX > effectiveRect.right() && lineHeight > 0) {
x = effectiveRect.x();
y = y + lineHeight + spaceY;
nextX = x + item->sizeHint().width() + spaceX;
lineHeight = 0;
}
if (!testOnly) {
QSize s = item->sizeHint();
if (nextX - spaceX > effectiveRect.right()) {
QSize minSize = item->minimumSize();
int neededW = effectiveRect.right() - x;
s.setWidth(qMax(neededW, minSize.width()));
}
item->setGeometry(QRect(QPoint(x, y), s));
}
x = nextX;
lineHeight = qMax(lineHeight, item->sizeHint().height());
}