本文整理汇总了C++中FlowLayout::setSizeConstraint方法的典型用法代码示例。如果您正苦于以下问题:C++ FlowLayout::setSizeConstraint方法的具体用法?C++ FlowLayout::setSizeConstraint怎么用?C++ FlowLayout::setSizeConstraint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlowLayout
的用法示例。
在下文中一共展示了FlowLayout::setSizeConstraint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
QWidget *TilesetItemBox::makeCategory(const QString &categoryItem)
{
QTabWidget *TileSetsCategories = ui->TileSetsCategories;
QWidget *catWid;
QWidget *scrollWid;
QGridLayout *catLayout;
QLabel *grpLabel;
QComboBox *tilesetGroup;
QSpacerItem *spItem;
QScrollArea *TileSets;
FlowLayout *theLayOut;
catWid = new QWidget();
scrollWid = new QWidget();
catLayout = new QGridLayout(catWid);
catLayout->setSpacing(0);
catLayout->setContentsMargins(0, 0, 0, 0);
grpLabel = new QLabel(catWid);
grpLabel->setText(tr("Group:"));
catLayout->addWidget(grpLabel, 0, 0, 1, 1);
tilesetGroup = new QComboBox(catWid);
catLayout->addWidget(tilesetGroup, 0, 1, 1, 1);
tilesetGroup->setInsertPolicy(QComboBox::InsertAlphabetically);
spItem = new QSpacerItem(1283, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
catLayout->addItem(spItem, 0, 2, 1, 1);
TileSets = new QScrollArea(catWid);
TileSets->setWidget(scrollWid);
TileSets->setWidgetResizable(true);
TileSets->setFrameShape(QFrame::StyledPanel);
TileSets->setFrameShadow(QFrame::Raised);
TileSets->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
TileSets->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
theLayOut = new FlowLayout(scrollWid);
theLayOut->setSizeConstraint(QLayout::SetNoConstraint);
catLayout->addWidget(TileSets, 1, 0, 1, 3);
TileSetsCategories->addTab(catWid, QString());
TileSetsCategories->setTabText(TileSetsCategories->indexOf(catWid), categoryItem);
return catWid;
}