Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML and ~(#include "file.h")
Forum Updated to NodeBB v4.3 + New Features

QML and ~(#include "file.h")

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.5k Views 2 Watching
  • 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.
  • P Offline
    P Offline
    Papa
    wrote on last edited by
    #1

    I just started reading about QML, it looks fantastic! However, I have a question that I feel is naive, but concerning at the same time.
    As we store code in 'h' files when programming in C++ to later be recall, I wonder if QML provides the same concept.

    Thanks

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      It does provide the concept of include for reuse objects in projects
      http://doc.qt.io/qt-4.8/qmlreusablecomponents.html

      If that what yo u mean?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Papa
        wrote on last edited by
        #3

        Thanks for the reply.
        I noticed in the examples in the web page link provided, that the only 'import' are from 'QtQuick 1.0', however, programs are normally structured randomly, for example, the main / default developing folder might be 'C:\qt\app', but the QT libraries are in in E:\dev\c++\Qt\QML\myQmlLib', D:\dev\c++\Qt\QML\Tim_Berners-LeeQmlLib' and E:\dev\c++\Qt\QML\Monica_BelluccisQmlLib'.
        How do I import this libraries which are in 'qml' files?
        Thanks in advance.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Hi
          i think
          you use a file to tell where to find stuff not in the project folder
          http://doc.qt.io/qt-5/qtqml-modules-qmldir.html

          But im not sure if there is not a faster way.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Papa
            wrote on last edited by Papa
            #5

            Needs to be said, it is a very unconventional, to say the least, specially for a XML platform that will interface with C++. I would have expected QML to have an API that has more in common with C++ than with JavaScript. After all, C++ is one major reason in choosing Qt.
            Nonetheless, this unconventionality does not diminish, in any way, the facilities and niceness of Qt. I am loving it and I'd like to continue learning more about Qt and QML.

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Well you can fully use Qt Widgets
              and never use QML at all. its two very different
              technologies and target different use cases.
              I think they wanted it to be like java script.

              1 Reply Last reply
              0

              • Login

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