本文整理汇总了C++中QwtDynGridLayout::setAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtDynGridLayout::setAlignment方法的具体用法?C++ QwtDynGridLayout::setAlignment怎么用?C++ QwtDynGridLayout::setAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtDynGridLayout
的用法示例。
在下文中一共展示了QwtDynGridLayout::setAlignment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QwtAbstractLegend
/*!
Constructor
\param parent Parent widget
*/
QwtLegend::QwtLegend( QWidget *parent ):
QwtAbstractLegend( parent )
{
setFrameStyle( NoFrame );
d_data = new QwtLegend::PrivateData;
d_data->view = new QwtLegend::PrivateData::LegendView( this );
d_data->view->setObjectName( "QwtLegendView" );
d_data->view->setFrameStyle( NoFrame );
QwtDynGridLayout *gridLayout = new QwtDynGridLayout(
d_data->view->contentsWidget );
gridLayout->setAlignment( Qt::AlignHCenter | Qt::AlignTop );
d_data->view->contentsWidget->installEventFilter( this );
QVBoxLayout *layout = new QVBoxLayout( this );
layout->setContentsMargins( 0, 0, 0, 0 );
layout->addWidget( d_data->view );
}
示例2: QFrame
/*!
\param parent Parent widget
*/
QwtLegend::QwtLegend(QWidget *parent):
QFrame(parent)
{
setFrameStyle(NoFrame);
d_data = new QwtLegend::PrivateData;
d_data->itemMode = QwtLegend::ReadOnlyItem;
d_data->displayPolicy = QwtLegend::Auto;
d_data->identifierMode = QwtLegendItem::ShowLine |
QwtLegendItem::ShowSymbol | QwtLegendItem::ShowText;
d_data->view = new QwtLegend::PrivateData::LegendView(this);
d_data->view->setFrameStyle(NoFrame);
QwtDynGridLayout *layout = new QwtDynGridLayout(
d_data->view->contentsWidget);
#if QT_VERSION < 0x040000
layout->setAutoAdd(true);
#endif
layout->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
d_data->view->contentsWidget->installEventFilter(this);
}