本文整理汇总了C++中PythonQtObjectPtr::removeVariable方法的典型用法代码示例。如果您正苦于以下问题:C++ PythonQtObjectPtr::removeVariable方法的具体用法?C++ PythonQtObjectPtr::removeVariable怎么用?C++ PythonQtObjectPtr::removeVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PythonQtObjectPtr
的用法示例。
在下文中一共展示了PythonQtObjectPtr::removeVariable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Uninitialize
void PythonScriptModule::Uninitialize()
{
// Clear script created input contexts.
createdInputs_.clear();
PythonQtObjectPtr mainModule = PythonQt::self()->getMainModule();
if (!mainModule.isNull())
{
mainModule.removeVariable("_pythonscriptmodule");
mainModule.removeVariable("_tundra");
}
// This will remove all the signal handlers in PythonQt.
// This function is only available in the modified PythonQt realXtend Tundra made.
// Otherwise our app will crash when deleting the framework APIs as there are connected signals still to python slots.
LogInfo("PythonScriptModule: Disconnecting all PythonQt connected signals");
PythonQt::priv()->disconnectAllSignalReceivers();
PythonQt::priv()->deleteAllSignalReceivers();
// Note that we do not call Py_Finalize() before or after PythonQt::cleanup()
// as this will crash either way after doing the above. Let python release its memory when the dll is unloaded.
LogInfo("PythonScriptModule: Running PythonQt cleanup");
PythonQt::cleanup();
}