Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problems with .qmltype file generation

Problems with .qmltype file generation

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 1.4k Views
  • 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.
  • IzowiuzI Offline
    IzowiuzI Offline
    Izowiuz
    wrote on last edited by Izowiuz
    #1

    Hello :]

    I have a little problem when I try to generate .qmltype files for my plugins.
    For example, I have a plugin named IzLibrary.

    This plugin resides in its import folder, in it I have:

    • qmldir file
    • IzLibraryPlugin.dll file
    • generated izlibrary.qmltypes file

    Whole contents of qmldir file are:

    // file start
    module IzLibrary
    plugin IzLibraryPlugin
    typeinfo izlibrary.qmltypes
    classname IzQMLComponents
    IzToast 1.0 qrc:///src/JS/IzToast.js
    IzMark 1.0 qrc:///src/JS/IzMark.js
    IzBusy 1.0 qrc:///src/JS/IzBusy.js
    // file end

    To generate izlibrary.qmltypes file I use:

    qmlplugindump IzLibrary 1.0 ./ > ./IzLibrary/izlibrary.qmltypes
    

    This command generates, what I think is, a proper .qmltypes file:

    import QtQuick.tooling 1.2
    
    // This file describes the plugin-supplied types contained in the library.
    // It is used for QML tooling purposes only.
    //
    // This file was auto-generated by:
    // 'qmlplugindump IzLibrary 1.0 ./'
    
    Module {
        dependencies: []
        Component {
            name: "QDoubleValidator"
            prototype: "QValidator"
            exports: ["IzDoubleValidator 1.0"]
            exportMetaObjectRevisions: [0]
    
            [~here be 4000 more lines of similar stuff~]
    
        }
    }
    

    But under QtCreator 4.6, under General Messages, I get:

    Warnings while parsing QML type information of C:/Users/jakubn/Documents/projekty/qt-projects/deploy/plugins/release/5.9.4/msvc/x86/IzLibrary:
    Failed to parse "C:/Users/jakubn/Documents/projekty/qt-projects/deploy/plugins/release/5.9.4/msvc/x86/IzLibrary/izlibrary.qmltypes".
    Error: 1:1: Expected token "numeric literal".
    QML module does not contain information about components contained in plugins.
    

    Is there something I did wrong?

    For testing, I pasted contents from qts docs into the izlibrary.qmltypes but error stays the same.

    1 Reply Last reply
    0
    • IzowiuzI Offline
      IzowiuzI Offline
      Izowiuz
      wrote on last edited by
      #2

      The reason for this error was improper encoding of the .qmltypes file.
      When I manually resaved it in UTF-8 problem went away.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved