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