本文整理汇总了C++中document::Ptr::bind方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::bind方法的具体用法?C++ Ptr::bind怎么用?C++ Ptr::bind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类document::Ptr
的用法示例。
在下文中一共展示了Ptr::bind方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: populateImportedTypes
void LinkPrivate::populateImportedTypes(Imports *imports, Document::Ptr doc)
{
importableModuleApis.clear();
// implicit imports: the <default> package is always available
loadImplicitDefaultImports(imports);
// implicit imports:
// qml files in the same directory are available without explicit imports
if (doc->isQmlDocument())
loadImplicitDirectoryImports(imports, doc);
// explicit imports, whether directories, files or libraries
foreach (const ImportInfo &info, doc->bind()->imports()) {
Import import = importCache.value(ImportCacheKey(info));
// ensure usage of the right ImportInfo, the cached import
// can have a different 'as' clause...
import.info = info;
if (!import.object) {
switch (info.type()) {
case ImportType::File:
case ImportType::Directory:
case ImportType::QrcFile:
case ImportType::QrcDirectory:
import = importFileOrDirectory(doc, info);
break;
case ImportType::Library:
import = importNonFile(doc, info);
break;
case ImportType::UnknownFile:
imports->setImportFailed();
if (info.ast()) {
error(doc, info.ast()->fileNameToken,
Link::tr("File or directory not found."));
}
break;
default:
break;
}
if (import.object)
importCache.insert(ImportCacheKey(info), import);
}
if (import.object)
imports->append(import);
}
}
示例2: apply
void QuickToolBar::apply(TextEditor::BaseTextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force)
{
if (!QuickToolBarSettings::get().enableContextPane && !force && !update) {
contextWidget()->hide();
return;
}
if (document.isNull())
return;
if (update && editorWidget != m_editorWidget)
return; //do not update for different editor
m_blockWriting = true;
const ObjectValue *scopeObject = document->bind()->findQmlObject(node);
bool isPropertyChanges = false;
if (scopeChain && scopeObject) {
m_prototypes.clear();
foreach (const ObjectValue *object,
PrototypeIterator(scopeObject, scopeChain->context()).all()) {
m_prototypes.append(object->className());
}
if (m_prototypes.contains(QLatin1String("PropertyChanges"))) {
isPropertyChanges = true;
const ObjectValue *targetObject = getPropertyChangesTarget(node, *scopeChain);
m_prototypes.clear();
if (targetObject) {
foreach (const ObjectValue *object,
PrototypeIterator(targetObject, scopeChain->context()).all()) {
m_prototypes.append(object->className());
}
}
}