当前位置: 首页>>代码示例>>C++>>正文


C++ KviKvsObject::object方法代码示例

本文整理汇总了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;
}
开发者ID:Heufneutje,项目名称:KVIrc,代码行数:27,代码来源:KvsObject_mainWindow.cpp

示例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;
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:27,代码来源:KvsObject_trayIcon.cpp

示例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;
}
开发者ID:kartagis,项目名称:KVIrc,代码行数:19,代码来源:KvsObject_wizard.cpp

示例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;
}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:16,代码来源:KvsObject_workspace.cpp

示例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;
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:20,代码来源:KvsObject_hBox.cpp

示例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;
}
开发者ID:Heufneutje,项目名称:KVIrc,代码行数:40,代码来源:KvsObject_vBox.cpp


注:本文中的KviKvsObject::object方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。