本文整理汇总了C++中GetUniqueItem函数的典型用法代码示例。如果您正苦于以下问题:C++ GetUniqueItem函数的具体用法?C++ GetUniqueItem怎么用?C++ GetUniqueItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetUniqueItem函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyErr_SetString
PyObject *scribus_setlinespacemode(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
int w;
if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
return NULL;
if(!checkHaveDocument())
return NULL;
if (w < 0 || w > 3) // Use constants?
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Line space mode invalid, must be 0, 1 or 2","python error").toLocal8Bit().constData());
return NULL;
}
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set line spacing mode on a non-text frame.","python error").toLocal8Bit().constData());
return NULL;
}
int Apm = ScCore->primaryMainWindow()->doc->appMode;
ScCore->primaryMainWindow()->doc->m_Selection->clear();
ScCore->primaryMainWindow()->doc->m_Selection->addItem(i);
if (i->HasSel)
ScCore->primaryMainWindow()->doc->appMode = modeEdit;
ScCore->primaryMainWindow()->doc->itemSelection_SetLineSpacingMode(w);
ScCore->primaryMainWindow()->doc->appMode = Apm;
ScCore->primaryMainWindow()->view->Deselect();
Py_RETURN_NONE;
}
示例2: GetUniqueItem
PyObject *scribus_settablebottomborder(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 bottom border on a non-table item.","python error").toLocal8Bit().constData());
return nullptr;
}
bool ok = false;
TableBorder border = parseBorder(borderLines, &ok);
if (ok)
table->setBottomBorder(border);
else
return nullptr;
Py_RETURN_NONE;
}
示例3: GetUniqueItem
PyObject *scribus_inserthtmltext(PyObject* /* self */, PyObject* args)
{
char *name = const_cast<char*>("");
char *file;
QString data;
if (!PyArg_ParseTuple(args, "es|es", "utf-8", &file, "utf-8", &name)) {
return NULL;
}
if(!checkHaveDocument()) {
return NULL;
}
PageItem *it = GetUniqueItem(QString::fromUtf8(name));
if (it == NULL) {
return NULL;
}
if (!(it->asTextFrame()) && !(it->asPathText())) {
PyErr_SetString(WrongFrameTypeError,
QObject::tr("Cannot insert text into non-text frame.",
"python error").toLocal8Bit().constData());
return NULL;
}
QString fileName = QString::fromUtf8(file);
gtGetText gt(ScCore->primaryMainWindow()->doc);
gt.launchImporter(-1, fileName, false, QString("utf-8"), false, it);
// FIXME: PyMem_Free() - are any needed??
Py_RETURN_NONE;
}
示例4: GetUniqueItem
PyObject *scribus_getfillblend(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
return NULL;
if(!checkHaveDocument())
return NULL;
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
return i != NULL ? PyInt_FromLong(static_cast<long>(i->fillBlendmode())) : NULL;
}
示例5: RAISE
void DocumentAPI::unGroupItems(QString name)
{
if (!check())
RAISE("No document open");
PageItem *i = GetUniqueItem(name);
if (i == NULL)
RAISE("Item not found.");
ScCore->primaryMainWindow()->view->Deselect();
ScCore->primaryMainWindow()->view->SelectItem(i);
ScCore->primaryMainWindow()->UnGroupObj();
}