[Qt-creator] crash in QReadLocker when I try to reuse QmlDesigner source code

Дмитрий Шмыков d.shmykov at nexters.com
Mon Oct 12 11:52:00 CEST 2015


Hi friends.

I've tried to write a question to the IRC but its text seems to be long 
so I ask here if anybody can help me with reusing QTC source code in my 
project. This question isn't bound directly with any QTC bug.

I'm writing a function that takes qml file path as input and should 
return populated QmlDesigner::Model as output. Then I use 
QmlDesigner::Model to work with qml document that contains domain 
specific info for my application.

I'm gettng a crash in QReadLocker and I've posted the question to this 
forum https://forum.qt.io/topic/59648/crash-in-qreadlocker .

Here's the function's source code. Please tell me if I reuse QTC source 
code incorrectly.

std::shared_ptr<QmlDesigner::Model> 
DialogFactory::populateNodeTreeFromFile(const std::string& fileName)
{
     // reading the file
     const QString qfileName = QString::fromStdString(fileName);
     QFile f(qfileName);
     if (!f.open(QFile::ReadOnly | QFile::Text))
         return nullptr;
     QTextStream in(&f);
     m_rewriterView->setPlainText(in.readAll()); // m_rewriterView is 
created in the constructor
     // populating the model
     m_docModel->setFileUrl(QUrl::fromLocalFile(qfileName));
     m_docModel->setRewriterView(m_rewriterView);
     //--
     return m_docModel;
}

Thanks in advance.
-- 
	*Шмыков Дмитрий *
программист
www.nexters.com <http://www.nexters.com>
+7 985 915 0966
skype: dmitryshm1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20151012/05ba7b3b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nexters_logo.png
Type: image/png
Size: 4087 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20151012/05ba7b3b/attachment.png>


More information about the Qt-creator mailing list