本文整理汇总了C++中PageItem_Table::setTopBorder方法的典型用法代码示例。如果您正苦于以下问题:C++ PageItem_Table::setTopBorder方法的具体用法?C++ PageItem_Table::setTopBorder怎么用?C++ PageItem_Table::setTopBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageItem_Table
的用法示例。
在下文中一共展示了PageItem_Table::setTopBorder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetUniqueItem
PyObject *scribus_settabletopborder(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
PyObject* borderLines;
if (!PyArg_ParseTuple(args, "O|es", &borderLines, "utf-8", &Name))
return nullptr;
if (!checkHaveDocument())
return nullptr;
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == nullptr)
return nullptr;
PageItem_Table *table = i->asTable();
if (!table)
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set table top border on a non-table item.","python error").toLocal8Bit().constData());
return nullptr;
}
bool ok = false;
TableBorder border = parseBorder(borderLines, &ok);
if (ok)
table->setTopBorder(border);
else
return nullptr;
Py_RETURN_NONE;
}
示例2: updateBorders
void PropertiesPalette_Table::updateBorders()
{
if (!m_doc || !m_item || !m_item->isTable())
return;
PageItem_Table* table = m_item->asTable();
TableSideSelector::Sides selectedSides = sideSelector->selection();
m_doc->dontResize = true;
if (m_doc->appMode != modeEditTable)
{
if (selectedSides & TableSideSelector::Left)
table->setLeftBorder(m_currentBorder);
if (selectedSides & TableSideSelector::Right)
table->setRightBorder(m_currentBorder);
if (selectedSides & TableSideSelector::Top)
table->setTopBorder(m_currentBorder);
if (selectedSides & TableSideSelector::Bottom)
table->setBottomBorder(m_currentBorder);
}
else
{
TableCell cell = table->activeCell();
if (selectedSides & TableSideSelector::Left)
cell.setLeftBorder(m_currentBorder);
if (selectedSides & TableSideSelector::Right)
cell.setRightBorder(m_currentBorder);
if (selectedSides & TableSideSelector::Top)
cell.setTopBorder(m_currentBorder);
if (selectedSides & TableSideSelector::Bottom)
cell.setBottomBorder(m_currentBorder);
}
table->adjustTable();
table->update();
}