本文整理汇总了C++中KviKvsObject::object方法的典型用法代码示例。如果您正苦于以下问题:C++ KviKvsObject::object方法的具体用法?C++ KviKvsObject::object怎么用?C++ KviKvsObject::object使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KviKvsObject
的用法示例。
在下文中一共展示了KviKvsObject::object方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
KVSO_CLASS_FUNCTION(mainWindow,setCentralWidget)
{
CHECK_INTERNAL_POINTER(widget())
KviKvsObject * pObject;
kvs_hobject_t hObject;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject)
KVSO_PARAMETERS_END(c)
pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
if (!pObject)
{
c->warning(__tr2qs_ctx("Widget parameter is not an object","objects"));
return true;
}
if (!pObject->object())
{
c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects"));
return true;
}
if(!pObject->inheritsClass("widget"))
{
c->warning(__tr2qs_ctx("Widget object required","objects"));
return true;
}
((KviTalMainWindow *)widget())->setCentralWidget(((QWidget *)(pObject->object())));
return true;
}
示例2:
KVSO_CLASS_FUNCTION(trayIcon,setContextMenu)
{
CHECK_INTERNAL_POINTER(m_pTrayIcon)
KviKvsObject *ob;
kvs_hobject_t hObject;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject)
KVSO_PARAMETERS_END(c)
ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
if (!ob)
{
c->warning(__tr2qs_ctx("Widget parameter is not an object","objects"));
return true;
}
if (!ob->object())
{
c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects"));
return true;
}
if(!ob->inheritsClass("popupmenu"))
{
c->warning(__tr2qs_ctx("Can't add a non-popupmenu object","objects"));
return true;
}
m_pTrayIcon->setContextMenu(((QMenu *)(ob->object())));
return true;
}
示例3:
KVSO_CLASS_FUNCTION(wizard,setTitle)
{
CHECK_INTERNAL_POINTER(widget())
KviKvsObject *ob;
QString szTitle;
kvs_hobject_t hObject;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject)
KVSO_PARAMETER("title",KVS_PT_STRING,0,szTitle)
KVSO_PARAMETERS_END(c)
ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
if(!ob->object()->isWidgetType())
{
c->warning(__tr2qs_ctx("Widget object required","objects"));
return true;
}
((KviTalWizard *)widget())->setPageTitle(((QWidget *)(ob->object())),szTitle);
return true;
}
示例4:
KVSO_CLASS_FUNCTION(workspace,addSubWindow)
{
CHECK_INTERNAL_POINTER(widget())
KviKvsObject * pObject;
kvs_hobject_t hObject;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject)
KVSO_PARAMETERS_END(c)
pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
CHECK_HOBJECT_IS_WIDGET(pObject)
QMdiSubWindow *pMdi=((QMdiArea *)object())->addSubWindow(((QWidget *)(pObject->object())));
pWidgetDict->insert(hObject,pMdi);
((QMdiArea *)object())->setActiveSubWindow(pMdi);
return true;
}
示例5:
KVSO_CLASS_FUNCTION(hBox,setStretchFactor)
{
CHECK_INTERNAL_POINTER(widget())
KviKvsObject * pObject;
kvs_hobject_t hObject;
kvs_uint_t uStretch;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject)
KVSO_PARAMETER("stretch",KVS_PT_UNSIGNEDINTEGER,0,uStretch)
KVSO_PARAMETERS_END(c)
pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
CHECK_HOBJECT_IS_WIDGET(pObject)
if(((KvsObject_widget *)pObject)->widget()->parentWidget() != widget())
{
c->warning(__tr2qs_ctx("The widget must be a child of this hbox","objects"));
return true;
}
((KviTalHBox *)widget())->setStretchFactor(((QWidget *)(pObject->object())),uStretch);
return true;
}
示例6:
KVSO_CLASS_FUNCTION(vBox,setAlignment)
{
CHECK_INTERNAL_POINTER(widget())
QStringList alignment;
KviKvsObject * pObject;
kvs_hobject_t hObject;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject)
KVSO_PARAMETER("alignment",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,alignment)
KVSO_PARAMETERS_END(c)
pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
CHECK_HOBJECT_IS_WIDGET(pObject)
if(((KvsObject_widget *)pObject)->widget()->parentWidget() != widget())
{
c->warning(__tr2qs_ctx("The widget must be a child of this hbox","objects"));
return true;
}
int align,sum=0;
for ( QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it )
{
align = 0;
for(unsigned int j = 0; j < align_num; j++)
{
if(KviQString::equalCI((*it), align_tbl[j]))
{
align=align_cod[j];
break;
}
}
if(align)
sum = sum | align;
else
c->warning(__tr2qs_ctx("Unknown alignment: '%Q'","objects"),&(*it));
}
if (widget()) ((KviTalHBox *)widget())->setAlignment(((QWidget *)(pObject->object())),(Qt::Alignment)sum);
return true;
}