本文整理汇总了C++中QTabWidget::setUpLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setUpLayout方法的具体用法?C++ QTabWidget::setUpLayout怎么用?C++ QTabWidget::setUpLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::setUpLayout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeHint
/*!
\reimp
*/
QSize QTabWidget::sizeHint() const
{
Q_D(const QTabWidget);
QSize lc(0, 0), rc(0, 0);
QStyleOption opt(0);
opt.init(this);
opt.state = QStyle::State_None;
if (d->leftCornerWidget)
lc = d->leftCornerWidget->sizeHint();
if(d->rightCornerWidget)
rc = d->rightCornerWidget->sizeHint();
if (!d->dirty) {
QTabWidget *that = (QTabWidget*)this;
that->setUpLayout(true);
}
QSize s(d->stack->sizeHint());
QSize t(d->tabs->sizeHint());
if(usesScrollButtons())
t = t.boundedTo(QSize(200,200));
else
t = t.boundedTo(QApplication::desktop()->size());
QSize sz = basicSize(d->pos == North || d->pos == South, lc, rc, s, t);
return style()->sizeFromContents(QStyle::CT_TabWidget, &opt, sz, this)
.expandedTo(QApplication::globalStrut());
}
示例2: minimumSizeHint
/*!
\reimp
Returns a suitable minimum size for the tab widget.
*/
QSize QTabWidget::minimumSizeHint() const
{
Q_D(const QTabWidget);
QSize lc(0, 0), rc(0, 0);
if(d->leftCornerWidget)
lc = d->leftCornerWidget->minimumSizeHint();
if(d->rightCornerWidget)
rc = d->rightCornerWidget->minimumSizeHint();
if (!d->dirty) {
QTabWidget *that = (QTabWidget*)this;
that->setUpLayout(true);
}
QSize s(d->stack->minimumSizeHint());
QSize t(d->tabs->minimumSizeHint());
QSize sz = basicSize(d->pos == North || d->pos == South, lc, rc, s, t);
QStyleOption opt(0);
opt.rect = rect();
opt.palette = palette();
opt.state = QStyle::State_None;
return style()->sizeFromContents(QStyle::CT_TabWidget, &opt, sz, this)
.expandedTo(QApplication::globalStrut());
}
示例3: minimumSizeHint
/*!
\reimp
Returns a suitable minimum size for the tab widget.
*/
QSize QTabWidget::minimumSizeHint() const
{
QSize lc(0, 0), rc(0, 0);
if(d->leftCornerWidget)
lc = d->leftCornerWidget->minimumSizeHint();
if(d->rightCornerWidget)
rc = d->rightCornerWidget->minimumSizeHint();
if ( !d->dirty ) {
QTabWidget *that = (QTabWidget*)this;
that->setUpLayout( TRUE );
}
QSize s( d->stack->minimumSizeHint() );
QSize t( d->tabs->minimumSizeHint() );
QSize sz( QMAX( s.width(), t.width() + rc.width() + lc.width() ),
s.height() + (QMAX( rc.height(), QMAX(lc.height(), t.height()))) + ( d->tabBase->isVisible() ? d->tabBase->height() : 0 ) );
return style().sizeFromContents(QStyle::CT_TabWidget, this, sz).expandedTo(QApplication::globalStrut());
}