当前位置: 首页>>代码示例>>C++>>正文


C++ Guides::append方法代码示例

本文整理汇总了C++中Guides::append方法的典型用法代码示例。如果您正苦于以下问题:C++ Guides::append方法的具体用法?C++ Guides::append怎么用?C++ Guides::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Guides的用法示例。


在下文中一共展示了Guides::append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getAutoVerticals

Guides GuideManagerCore::getAutoVerticals(Page* page)
{
	Guides guides;
	double columnSize;
	int value = m_verticalAutoCount;
	double offset = 0.0;
	double newPageWidth = page->width();

	if (page == NULL)
		page = m_page;
	if (page == NULL)
		return guides;

	if (m_verticalAutoCount == 0)
		return guides;
	++value;

	if (m_verticalAutoRefer == 1)
	{
		newPageWidth = newPageWidth - page->Margins.Left - page->Margins.Right;
		offset = page->Margins.Left;
	}
	else if (m_verticalAutoRefer == 2)
	{
		if (qRound(page->guides.gx) != 0)
		{
			offset = page->guides.gx;
			newPageWidth = page->guides.gw;
		}
	}

	if (page->guides.verticalAutoGap() > 0.0)
		columnSize = (newPageWidth - (value - 1) * page->guides.verticalAutoGap()) / value;
	else
		columnSize = newPageWidth / value;

	for (int i = 1, gapCount = 0; i < value; ++i)
	{
		if (page->guides.verticalAutoGap() > 0.0)
		{
			guides.append(offset + i * columnSize + gapCount * page->guides.verticalAutoGap());
			++gapCount;
			guides.append(offset + i * columnSize + gapCount * page->guides.verticalAutoGap());
		}
		else
			guides.append(offset + columnSize * i);
	}
	return guides;
}
开发者ID:avary,项目名称:scribus,代码行数:49,代码来源:guidemanagercore.cpp

示例2: getAutoHorizontals

Guides GuideManagerCore::getAutoHorizontals(Page* page)
{
	Guides guides;
	double rowSize;
	int value = m_horizontalAutoCount;
	double offset = 0.0;
	double newPageHeight = page->height();

	if (page == NULL)
		page = m_page;
	if (page == NULL)
		return guides;

	if (m_horizontalAutoCount == 0)
		return guides;
	++value;

	if (m_horizontalAutoRefer == 1)
	{
		newPageHeight = newPageHeight - page->Margins.Top - page->Margins.Bottom;
		offset = page->Margins.Top;
	}
	else if (m_horizontalAutoRefer == 2)
	{
		if (qRound(page->guides.gy) != 0.0)
		{
			offset = page->guides.gy;
			newPageHeight = page->guides.gh;
		}
	}

	if (page->guides.horizontalAutoGap() > 0.0)
		rowSize = (newPageHeight - (value - 1) * page->guides.horizontalAutoGap()) / value;
	else
		rowSize = newPageHeight / value;

	for (int i = 1, gapCount = 0; i < value; ++i)
	{
		if (page->guides.horizontalAutoGap() > 0.0)
		{
			guides.append(offset + i * rowSize + gapCount * page->guides.horizontalAutoGap());
			++gapCount;
			guides.append(offset + i * rowSize + gapCount * page->guides.horizontalAutoGap());
		}
		else
			guides.append(offset + rowSize * i);
	}
	return guides;
}
开发者ID:avary,项目名称:scribus,代码行数:49,代码来源:guidemanagercore.cpp

示例3: selectedHorizontals

Guides GuideManager::selectedHorizontals()
{
	QModelIndex i;
	QModelIndexList selectedIndexes = horizontalView->selectionModel()->selectedIndexes();
	Guides ret;
	Guides curr = horizontalModel->values();
	foreach (i , selectedIndexes)
	{
		ret.append(curr.at(i.row()));
	}
开发者ID:AlterScribus,项目名称:ece15,代码行数:10,代码来源:guidemanager.cpp

示例4: delVerButton_clicked

void GuideManager::delVerButton_clicked()
{
	QModelIndexList indexes = verticalView->selectionModel()->selectedRows(0);
	QModelIndex ix;
	Guides v;

	foreach(ix, indexes)
		// here *must* go EditRole due truncations in DisplayRole
		// see GuidesModel::data()
		v.append(verticalModel->data(ix, Qt::EditRole).toDouble());

	verticalModel->removeValues(v);

	currentPage->guides.clearVerticals(GuideManagerCore::Standard);
	currentPage->guides.addVerticals(verticalModel->values(), GuideManagerCore::Standard);
	drawGuides();
	m_Doc->changed();
}
开发者ID:AlterScribus,项目名称:ece15,代码行数:18,代码来源:guidemanager.cpp


注:本文中的Guides::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。