예제 #1
0
void QSnippetEdit::on_leSnippetName_editingFinished()
{
	if ( m_editedSnippet < 0 )
		return;
	
	QSnippet *snip = m_manager->snippet(m_editedSnippet);
	
	snip->setName(leSnippetName->text());
	
	lwSnippets->item(m_editedSnippet + 1)->setText(snip->name());
}
예제 #2
0
bool QSnippetManager::loadSnippetFromString(const QString& name, const QString& s, const QString& type)
{
	QSnippetPatternLoader *pl = patternLoader(type);
	
	QSnippet *snip = pl->loadSnippet(s);
	
	if ( snip )
		snip->setName(name);
	
	addSnippet(snip);
	
	return snip;
}