本文整理汇总了C++中PageView::setSceneRect方法的典型用法代码示例。如果您正苦于以下问题:C++ PageView::setSceneRect方法的具体用法?C++ PageView::setSceneRect怎么用?C++ PageView::setSceneRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageView
的用法示例。
在下文中一共展示了PageView::setSceneRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPage
void MultiPageLayout::addPage( Page * page, int pageIndex, PagePosition position )
{
PageView *view = new PageView(page);
view->setSceneRect(0,0,page->width(),page->height());
int fromCol, columnSpan;
switch(position)
{
case SinglePage:
fromCol = 2;
columnSpan = 2;
break;
case DoublePageFirst:
fromCol = 2;
columnSpan = 1;
break;
case DoublePageSecond:
fromCol = 3;
columnSpan = 1;
break;
}
view->setZoom(zoom);
connect(this,SIGNAL(zoomChanged(double)),view,SLOT(setZoom(double)));
addWidget( view , 1, fromCol, 1, columnSpan, Qt::AlignCenter );
PageControlWidget *control = new PageControlWidget(book, page);
addWidget(control,2,fromCol,1,columnSpan, Qt::AlignCenter);
switch(position)
{
case SinglePage:
case DoublePageFirst:
if(bSwapDirection)
{
connect(control,SIGNAL(addPage()),this,SLOT(addPageAfterSecond()));
connect(control,SIGNAL(removePage()),this,SLOT(removeSecondPage()));
connect(control,SIGNAL(addPageFromTemplate(LayoutTemplate*)),this,SLOT(addPageAfterSecond(LayoutTemplate*)));
}
else
{
connect(control,SIGNAL(addPage()),this,SLOT(addPageAfterFirst()));
connect(control,SIGNAL(removePage()),this,SLOT(removeFirstPage()));
connect(control,SIGNAL(addPageFromTemplate(LayoutTemplate*)),this,SLOT(addPageAfterFirst(LayoutTemplate*)));
}
break;
case DoublePageSecond:
if(bSwapDirection)
{
connect(control,SIGNAL(addPage()),this,SLOT(addPageAfterFirst()));
connect(control,SIGNAL(removePage()),this,SLOT(removeFirstPage()));
connect(control,SIGNAL(addPageFromTemplate(LayoutTemplate*)),this,SLOT(addPageAfterFirst(LayoutTemplate*)));
}
else
{