Qt Forum

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

    Qt Academy Launch in California!

    Unsolved relate to qmlRegisterType

    India
    3
    6
    1790
    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.
    • M
      Monikarajendra last edited by aha_1980

      qmlRegisterType<BackEnd>("io.qt.examples.backend", 1, 0, "BackEnd");can somebody specify what to give for the first parameter "io.qt.examples.backend" to register a class in QML and am getting error as qmlRegisterType is not declared in the scope

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

        @Monikarajendra said in relate to qmlREgisterType:

        qmlRegisterType is not declared in the scope

        You have to include the correct header.

        #include <QQmlEngine>
        

        can somebody specify what to give for the first parameter "io.qt.examples.backend"

        While your issue has nothing to do with that URL, I'll still answer: it can be anything. Any string (well let's say any ascii alphanumeric string).

        (Z(:^

        1 Reply Last reply Reply Quote 2
        • M
          Monikarajendra last edited by

          even after including that appropriate headerfile am still facing the same error

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

            Hm that's unlikely. Is your BackEnd a qobject?

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • S
              shaan7 last edited by

              @Monikarajendra can you paste the exact error? Makes it much easier to find out the solution.

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

                One more question: are you using Qt 4 by any chance?

                (Z(:^

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