June 22, 2012

cmessineo cmessineo
Lab Rat
26 posts

Qt Designer - QML file creation

 

Hi, when I add a new QML file in the designer to a project, the top of the file has this line in it:

import QtQuick 1.0

I’m not sure if this is doable, but is there a way to change this behavior and have another import line added below.

Something like
import QtQuick 1.0
import MyModule 1.0

Thanks

5 replies

June 22, 2012

tucnak tucnak
Robot Herder
384 posts

What is the question?

 Signature 

Qt Developer (upper-intermediate)
PHP/JS Developer (intermediate)

June 22, 2012

sierdzio sierdzio
Area 51 Engineer
2321 posts

He wants to change the default file template in Qt Creator.

 Signature 

(Z(:^

June 22, 2012

tucnak tucnak
Robot Herder
384 posts
sierdzio wrote:
He wants to change the default file template in Qt Creator.

Ah. You can’t do it with built QtC, you should rebuild QtC with custom templates.

 Signature 

Qt Developer (upper-intermediate)
PHP/JS Developer (intermediate)

June 24, 2012

Tobias Hunger Tobias Hunger
Mad Scientist
3130 posts

The new file qml template seems to be indeed hardcoded in src/plugins/qmljseditor/qmlfilewizard.cpp.

It might be a good idea to file a feature request at http://bugreports.qt-project.org/ to have this changed.

June 24, 2012

cmessineo cmessineo
Lab Rat
26 posts

Thanks for answering my question. I also found template files that can be updated in QtCreator/share/qtcreator/templates/qtquickapp/qml/

 
  ‹‹ ListModel and onChanged signals      QML only connect to mySQL ››

You must log in to post a reply. Not a member yet? Register here!