本文整理汇总了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;
}
示例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;
}
示例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()));
}
示例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();
}