Permalink
Browse files

qmlui: make sure newly created functions have the right name in tree …

…model
  • Loading branch information...
mcallegari committed Nov 20, 2018
1 parent 8f60538 commit a6f668715c11bb365aaf53a442f413a512532dc7
Showing with 2 additions and 3 deletions.
  1. +2 −3 qmlui/functionmanager.cpp
@@ -208,14 +208,13 @@ quint32 FunctionManager::addFunctiontoDoc(Function *func, QString name, bool sel
if (func == NULL)
return Function::invalidId();
func->setName(QString("%1 %2").arg(name).arg(m_doc->nextFunctionID()));
if (m_doc->addFunction(func) == true)
{
if (select)
{
m_functionTree->setItemRoleData(func->name(), 1, TreeModel::IsSelectedRole);
}
func->setName(QString("%1 %2").arg(name).arg(func->id()));
QQmlEngine::setObjectOwnership(func, QQmlEngine::CppOwnership);
if (select)

0 comments on commit a6f6687

Please sign in to comment.