本文整理汇总了C++中TextDocument::url方法的典型用法代码示例。如果您正苦于以下问题:C++ TextDocument::url方法的具体用法?C++ TextDocument::url怎么用?C++ TextDocument::url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextDocument
的用法示例。
在下文中一共展示了TextDocument::url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotFinishedCompile
void ProcessChain::slotFinishedCompile(Language *language)
{
ProcessOptions options = language->processOptions();
if ( options.b_addToProject && ProjectManager::self()->currentProject() )
ProjectManager::self()->currentProject()->addFile( KUrl(options.targetFile()) );
ProcessOptions::ProcessPath::MediaType typeTo = ProcessOptions::ProcessPath::to( m_processOptions.processPath() );
TextDocument * editor = 0l;
if ( KTLConfig::reuseSameViewForOutput() )
{
editor = options.textOutputTarget();
if ( editor && (!editor->url().isEmpty() || editor->isModified()) )
editor = 0l;
}
switch (typeTo)
{
case ProcessOptions::ProcessPath::AssemblyAbsolute:
case ProcessOptions::ProcessPath::AssemblyRelocatable:
case ProcessOptions::ProcessPath::C:
case ProcessOptions::ProcessPath::Disassembly:
case ProcessOptions::ProcessPath::Library:
case ProcessOptions::ProcessPath::Microbe:
case ProcessOptions::ProcessPath::Object:
case ProcessOptions::ProcessPath::Program:
{
switch ( options.method() )
{
case ProcessOptions::Method::LoadAsNew:
{
if ( !editor )
editor = DocManager::self()->createTextDocument();
if ( !editor )
break;
QString text;
QFile f( options.targetFile() );
if ( !f.open( QIODevice::ReadOnly ) )
{
editor->deleteLater();
editor = 0l;
break;
}
QTextStream stream(&f);
while ( !stream.atEnd() )
text += stream.readLine()+'\n';
f.close();
editor->setText( text, true );
break;
}
case ProcessOptions::Method::Load:
{
editor = dynamic_cast<TextDocument*>( DocManager::self()->openURL(options.targetFile()) );
break;
}
case ProcessOptions::Method::Forget:
break;
}
}
case ProcessOptions::ProcessPath::FlowCode:
case ProcessOptions::ProcessPath::Pic:
case ProcessOptions::ProcessPath::Unknown:
break;
}
if (editor)
{
switch (typeTo)
{
case ProcessOptions::ProcessPath::AssemblyAbsolute:
case ProcessOptions::ProcessPath::AssemblyRelocatable:
{
if ( KTLConfig::autoFormatMBOutput() )
editor->formatAssembly();
editor->slotInitLanguage( TextDocument::ct_asm );
break;
}
case ProcessOptions::ProcessPath::C:
editor->slotInitLanguage( TextDocument::ct_c );
break;
case ProcessOptions::ProcessPath::Disassembly:
break;
case ProcessOptions::ProcessPath::Library:
case ProcessOptions::ProcessPath::Object:
case ProcessOptions::ProcessPath::Program:
editor->slotInitLanguage( TextDocument::ct_hex );
//.........这里部分代码省略.........