本文整理汇总了C++中QScrollArea::sizePolicy方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::sizePolicy方法的具体用法?C++ QScrollArea::sizePolicy怎么用?C++ QScrollArea::sizePolicy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::sizePolicy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizePolicy
SearchPinyin::SearchPinyin()
{
QVBoxLayout* vtLayout = new QVBoxLayout(this);
QLabel* pinyinLabel = new QLabel(this);
pinyinLabel->setText("Pinyin:");
vtLayout->addWidget(pinyinLabel);
pinyin = new QLineEdit(this);
vtLayout->addWidget(pinyin);
QLabel* disambiguateLabel = new QLabel(this);
disambiguateLabel->setText("Disambiguate:");
disambiguateLabel->setObjectName(QString::fromUtf8("label"));
vtLayout->addWidget(disambiguateLabel);
QScrollArea* candidatesScrollArea = new QScrollArea(this);
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(candidatesScrollArea->sizePolicy().hasHeightForWidth());
candidatesScrollArea->setSizePolicy(sizePolicy);
candidatesScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
candidatesScrollArea->setWidgetResizable(true);
candidates = new RowedList(font(), false, candidatesScrollArea);
candidatesScrollArea->setWidget(candidates);
candidatesScrollArea->setWidgetResizable(true);
vtLayout->addWidget(candidatesScrollArea);
stmt = createStatement(
"select utf8 from utf8Table join \
kMandarinTable on kMandarinTable.code = utf8Table.code \
where kMandarinTable.kMandarin = ?;");
connect(pinyin, SIGNAL(textEdited(QString)), this, SLOT(searchTermChanged(QString)));
connect(candidates, SIGNAL(characterSelected(QString)), this, SLOT(disambiguated(QString)));
}