Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Qt Designer - QML file creation

    QML and Qt Quick
    4
    6
    2234
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cmessineo
      cmessineo last edited by

      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

      1 Reply Last reply Reply Quote 0
      • T
        tucnak last edited by

        What is the question?

        1 Reply Last reply Reply Quote 0
        • sierdzio
          sierdzio Moderators last edited by

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

          (Z(:^

          1 Reply Last reply Reply Quote 0
          • T
            tucnak last edited by

            [quote author="sierdzio" date="1340354631"]He wants to change the default file template in Qt Creator.[/quote]

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

            1 Reply Last reply Reply Quote 0
            • T
              tobias.hunger last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • cmessineo
                cmessineo last edited by

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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post