本文整理汇总了C++中QSizePolicy::transpose方法的典型用法代码示例。如果您正苦于以下问题:C++ QSizePolicy::transpose方法的具体用法?C++ QSizePolicy::transpose怎么用?C++ QSizePolicy::transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSizePolicy
的用法示例。
在下文中一共展示了QSizePolicy::transpose方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTabShape
void pTabbedWorkspace::setTabShape( QTabBar::Shape s )
{
if ( tabShape() != s )
{
// get sizepolicy
QSizePolicy sp = mTabBar->sizePolicy();
// update view layout
switch ( s )
{
case QTabBar::RoundedNorth:
case QTabBar::TriangularNorth:
mTabLayout->setDirection( QBoxLayout::LeftToRight );
mLayout->setDirection( QBoxLayout::TopToBottom );
if ( tabShape() != QTabBar::RoundedSouth && tabShape() != QTabBar::TriangularSouth )
sp.transpose();
break;
case QTabBar::RoundedSouth:
case QTabBar::TriangularSouth:
mTabLayout->setDirection( QBoxLayout::LeftToRight );
mLayout->setDirection( QBoxLayout::BottomToTop );
if ( tabShape() != QTabBar::RoundedNorth && tabShape() != QTabBar::TriangularNorth )
sp.transpose();
break;
case QTabBar::RoundedWest:
case QTabBar::TriangularWest:
mTabLayout->setDirection( QBoxLayout::BottomToTop );
mLayout->setDirection( QBoxLayout::LeftToRight );
if ( tabShape() != QTabBar::RoundedEast && tabShape() != QTabBar::TriangularEast )
sp.transpose();
break;
case QTabBar::RoundedEast:
case QTabBar::TriangularEast:
mTabLayout->setDirection( QBoxLayout::TopToBottom );
mLayout->setDirection( QBoxLayout::RightToLeft );
if ( tabShape() != QTabBar::RoundedWest && tabShape() != QTabBar::TriangularWest )
sp.transpose();
break;
}
// set size policy
mTabBar->setSizePolicy( sp );
// apply tab shape
mTabBar->setShape( s );
// update corners
updateCorners();
// emit shape changed
emit tabShapeChanged( s );
}
}
示例2: setOrientation
/*!
\brief Set the wheel's orientation.
\param o Orientation. Allowed values are
Qt::Horizontal and Qt::Vertical.
Defaults to Qt::Horizontal.
\sa QwtAbstractSlider::orientation()
*/
void QwtWheel::setOrientation(Qt::Orientation o)
{
if ( orientation() == o )
return;
#if QT_VERSION >= 0x040000
if ( !testAttribute(Qt::WA_WState_OwnSizePolicy) )
#else
if ( !testWState( WState_OwnSizePolicy ) )
#endif
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy(sp);
#if QT_VERSION >= 0x040000
setAttribute(Qt::WA_WState_OwnSizePolicy, false);
#else
clearWState( WState_OwnSizePolicy );
#endif
}
QwtAbstractSlider::setOrientation(o);
layoutWheel();
}
示例3: setOrientation
/*!
\brief Set the orientation.
\param o Orientation. Allowed values are Qt::Horizontal and Qt::Vertical.
If the new orientation and the old scale position are an invalid combination,
the scale position will be set to QwtSlider::NoScale.
\sa QwtAbstractSlider::orientation()
*/
void QwtSlider::setOrientation( Qt::Orientation o )
{
if ( o == orientation() )
return;
if ( o == Qt::Horizontal )
{
if ( d_data->scalePos == LeftScale
|| d_data->scalePos == RightScale )
{
d_data->scalePos = NoScale;
}
}
else // if (o == Qt::Vertical)
{
if ( d_data->scalePos == BottomScale ||
d_data->scalePos == TopScale )
{
d_data->scalePos = NoScale;
}
}
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
QwtAbstractSlider::setOrientation( o );
layoutSlider( true );
}
示例4: setOrientation
/*!
\brief Set the thermometer orientation and the scale position.
The scale position NoScale disables the scale.
\param o orientation. Possible values are Qt::Horizontal and Qt::Vertical.
The default value is Qt::Vertical.
\param s Position of the scale.
The default value is NoScale.
A valid combination of scale position and orientation is enforced:
- a horizontal thermometer can have the scale positions TopScale,
BottomScale or NoScale;
- a vertical thermometer can have the scale positions LeftScale,
RightScale or NoScale;
- an invalid scale position will default to NoScale.
\sa QwtThermo::setScalePosition()
*/
void QwtThermo::setOrientation(Qt::Orientation o, ScalePos s)
{
if ( o == d_data->orientation && s == d_data->scalePos )
return;
switch(o)
{
case Qt::Horizontal:
{
if ((s == NoScale) || (s == BottomScale) || (s == TopScale))
d_data->scalePos = s;
else
d_data->scalePos = NoScale;
break;
}
case Qt::Vertical:
{
if ((s == NoScale) || (s == LeftScale) || (s == RightScale))
d_data->scalePos = s;
else
d_data->scalePos = NoScale;
break;
}
}
if ( o != d_data->orientation )
{
#if QT_VERSION >= 0x040000
if ( !testAttribute(Qt::WA_WState_OwnSizePolicy) )
#else
if ( !testWState( WState_OwnSizePolicy ) )
#endif
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy(sp);
#if QT_VERSION >= 0x040000
setAttribute(Qt::WA_WState_OwnSizePolicy, false);
#else
clearWState( WState_OwnSizePolicy );
#endif
}
}
d_data->orientation = o;
layoutThermo();
}
示例5: setOrientation
void QProgressBar::setOrientation(Qt::Orientation orientation)
{
Q_D(QProgressBar);
if (d->orientation == orientation)
return;
d->orientation = orientation;
if (!testAttribute(Qt::WA_WState_OwnSizePolicy)) {
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy(sp);
setAttribute(Qt::WA_WState_OwnSizePolicy, false);
}
d->resetLayoutItemMargins();
update();
updateGeometry();
}
示例6: setOrientation
/*!
\brief Set the wheel's orientation.
\param o Orientation. Allowed values are
Qt::Horizontal and Qt::Vertical.
Defaults to Qt::Horizontal.
\sa QwtAbstractSlider::orientation()
*/
void QwtWheel::setOrientation( Qt::Orientation o )
{
if ( orientation() == o )
return;
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
QwtAbstractSlider::setOrientation( o );
update();
}
示例7: setOrientation
/*!
\brief Set the wheel's orientation.
The default orientation is Qt::Horizontal.
\param orientation Qt::Horizontal or Qt::Vertical.
\sa orientation()
*/
void QwtWheel::setOrientation( Qt::Orientation orientation )
{
if ( d_data->orientation == orientation )
return;
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
d_data->orientation = orientation;
update();
}
示例8: setOrientation
/*!
\brief Set the orientation.
\param orientation Allowed values are Qt::Horizontal and Qt::Vertical.
\sa orientation(), scalePosition()
*/
void QwtThermo::setOrientation( Qt::Orientation orientation )
{
if ( orientation == d_data->orientation )
return;
d_data->orientation = orientation;
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
layoutThermo( true );
}
示例9: setOrientation
void QSplitter::setOrientation(Qt::Orientation orientation)
{
Q_D(QSplitter);
if (d->orient == orientation)
return;
if (!testAttribute(Qt::WA_WState_OwnSizePolicy)) {
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy(sp);
setAttribute(Qt::WA_WState_OwnSizePolicy, false);
}
d->orient = orientation;
for (int i = 0; i < d->list.size(); ++i) {
QSplitterLayoutStruct *s = d->list.at(i);
s->handle->setOrientation(orientation);
}
d->recalc(isVisible());
}
示例10: setOrientation
/*!
\brief Set the orientation.
\param orientation Allowed values are Qt::Horizontal and Qt::Vertical.
\sa orientation(), scalePosition()
*/
void QwtSlider::setOrientation( Qt::Orientation orientation )
{
if ( orientation == d_data->orientation )
return;
d_data->orientation = orientation;
scaleDraw()->setAlignment(
qwtScaleDrawAlignment( orientation, d_data->scalePosition ) );
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
示例11: setOrientation
/*!
\brief Set the orientation.
\param o Orientation. Allowed values are Qt::Horizontal and Qt::Vertical.
If the new orientation and the old scale position are an invalid combination,
the scale position will be set to QwtSlider::NoScale.
\sa QwtAbstractSlider::orientation()
*/
void QwtSlider::setOrientation(Qt::Orientation o)
{
if ( o == orientation() )
return;
if (o == Qt::Horizontal)
{
if ((d_data->scalePos == LeftScale) || (d_data->scalePos == RightScale))
d_data->scalePos = NoScale;
}
else // if (o == Qt::Vertical)
{
if ((d_data->scalePos == BottomScale) || (d_data->scalePos == TopScale))
d_data->scalePos = NoScale;
}
#if QT_VERSION >= 0x040000
if ( !testAttribute(Qt::WA_WState_OwnSizePolicy) )
#else
if ( !testWState( WState_OwnSizePolicy ) )
#endif
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy(sp);
#if QT_VERSION >= 0x040000
setAttribute(Qt::WA_WState_OwnSizePolicy, false);
#else
clearWState( WState_OwnSizePolicy );
#endif
}
QwtAbstractSlider::setOrientation(o);
layoutSlider();
}
示例12: transpose
int SizePolicy::transpose(lua_State * L)
{
QSizePolicy* lhs = QtValue<QSizePolicy>::check( L, 1 );
lhs->transpose();
return 0;
}