本文整理汇总了C++中PageItem_Table::removeColumns方法的典型用法代码示例。如果您正苦于以下问题:C++ PageItem_Table::removeColumns方法的具体用法?C++ PageItem_Table::removeColumns怎么用?C++ PageItem_Table::removeColumns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageItem_Table
的用法示例。
在下文中一共展示了PageItem_Table::removeColumns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetUniqueItem
PyObject *scribus_removetablecolumns(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
int index, numColumns;
if (!PyArg_ParseTuple(args, "ii|es", &index, &numColumns, "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 remove columns from a non-table item.","python error").toLocal8Bit().constData());
return nullptr;
}
if (index < 0 || index >= table->columns())
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Table column index out of bounds, must be >= 0 and < %1", "python error").arg(table->columns()).toLocal8Bit().constData());
return nullptr;
}
if (numColumns < 1 || numColumns >= table->columns())
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Table column count out of bounds, must be >= 1 and < %1", "python error").arg(table->columns()).toLocal8Bit().constData());
return nullptr;
}
if (index + numColumns > table->columns())
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Column deletion range out of bounds, index + numColumns must be <= %1", "python error").arg(table->columns()).toLocal8Bit().constData());
return nullptr;
}
table->removeColumns(index, numColumns);
Py_RETURN_NONE;
}