Qt is changing from C++ library to QML library... with KDAB
-
Hi
Im cannot share your concerns :)
QtQuick and QtQuick 2 is written in c++
All of QML is made in c++
Its meant to be used for dynamic user interfaces where the traditional widgets are uncommon or unwanted.
Its not meant to replace Qt c++ , nor can it at all.If you read the docs, you will see the recommendation is to use
QML for front end and c++ for back end.
QtQuick 2 is not Qt.
Its a very tiny part of all the classes.
http://doc.qt.io/qt-5/classes.htmlSo just as Qt is not a python library because there are bindings for python,
having the ability to define new types with c++ (AND QML) for QML,
does not alter in anyway that Qt is a c++ framework and will always be.
Just look at the sources. All c++.QML is just a tech. Nothing more. It would not exist without c++.
-
Thank you :-) that was a good way to explain it.
I think I am not clear on what I mean by word considered. Let me explain.I am working on getting schools, universities and colleges in parts of the Philppines to use C++ with Qt when teaching the students, and put away VisualBasic. This to help the students get experience with a more relevant technology.
What I experience is that more and more people that start playing with Qt, after I make this suggesting, come to me asking me about Javasript and QML... wondering why all that stuff is in there.
So techinically we can say that all is made in C++ etc. like you explained in a short and easy way, (I will use that when I explain this later) but people see QML as javascripting user interfaces if you understand what I mean, and its hard for me to get that impression to unstick..
For a student that picks up Qt to make an application, and then looks in the examples etc. it looks like this is a library that helps her make QML applications.
Is it really not possible to see that it looks this way to people that starts out with Qt ??
-
As already mentioned: QML is dependent on Qt/c++, not the other way around.
If you'd like to do or teach others how to do something without QML: don't add quickcontrols2, quick, charts, etc to your project. Problem solved?
I don't see why you wouldn't expose the declarative paradigm to new minds... it is far superior to <shudders> vb.
You can still do OpenGl/Vulkan/anything else c++ etc ... when people advance. Not every c++ app needs to be a QML app.
Also, RE: QML - you don't have to use Javascript blocks. Show off what you can do with Bindings, Property/NumberAnimations, Behaviours, States and Transitions... there's so much that literally doesn't ask for JS code.
-
Technically speaking, C++ is a single programming language but practically it's a bunch of multiple languages for different programming paradigms stuffed into that single language. We have domains in C++ for procedural programming, object oriented programming, meta programming, functional programming. Qt extends this with event-driven programming. For everything that can't be done in an easy / convenient way in C++, domain-specific languages are made accessible through libraries. DSLs that Qt supports are e.g.:
- SQL for databases
- OpenGL shader languages
- CSS for styling of widgets
- HTML / CSS for richtext
- PHP regular expressions
- JSON, XML, *.ini for data serialization
- qmake's language for the control of the application building process
- ECMA script for application scripting
QML is just another domain-specific language. The only thing that makes it kind of unique in this context is that AFAIK the Qt project offers the only implementation of a QML engine yet. There is no reason to pull QML support out of the Qt project like there is no reason to e.g. pull XML support out of it. And as QtQuick is vital for Qt as a cross platform GUI enabled framework, it's a no-brainer why QtQuick is maintained by the Qt project and not some unrelated 3rd-party.
-
@Wieland said in Qt is changing from C++ library to QML library... with KDAB:
There is no reason to pull QML support out of the Qt project as there is no reason to e.g. pull XML support out of it.
That is all very clear. I appreciate how you explained all that.
In general, not referring to Qt : When accessing a database, writing C++ language statements to use pre written code, we are using C++ and can consider that part of a C++ library. But if we are writing statemes in a different language to access that database, we are no longer writing C++, no longer using a C++ library.
So Qt is no longer a C++ library, but multiple librarys in mulitple laguages. It is a framework that includes librarys in multiple languages. So why are so many people insisting that Qt is a C++ framework/library ??
I hear you, and I hear other people explaing this stuff, but in my simple brain this just does not make sence. Sorry, but for me it just sounds like Qt is a framework where you use multiple langues, not just C++ / and therefor can not be called a pure C++ framework.
Sorry people, maybe I am just really slow...
-
So why are so many people insisting that Qt is a C++ framework/library ?
Well, our earth is called "the blue planet" because it looks blue when observed from a distance. A closer look reveals it's indeed very blue but not 100%. The overwhelming part of Qt sources is libraries, written in C++, exposing a C++ API. But there are also language bindings to Python and also non-library code, e.g. Creator, Designer, MOC , QBS and qmake. If you're looking for a C++ framework for cross platform development, you'll find Qt. Almost all of the code you'll write will be in C++ then. Almost all if not all your business logic will be C++. Same for the plumbing code that keeps everything together. But you'll probably also use inline Assembly for performance optimizations, SQL strings to communicate with a database, or OpenGL shader language to talk to the GPU. Or maybe you'll link your stuff to some old Fortran library. I can't think of any serious, or bigger, application that 100% only utilizes a single programming language, nor do I know a single programmer that only speaks one language.
-
@A.K.G. said in Qt is changing from C++ library to QML library... with KDAB:
So Qt is no longer a C++ library, but multiple librarys in mulitple laguages. It is a framework that includes librarys in multiple languages. So why are so many people insisting that Qt is a C++ framework/library ??
Qt is split into modules, and different modules will provide different things and have different requirements. As @Wieland said, you end up using a multitude of tools and languages in a tight package. Think about it like this:
Does it mean that Qt's not a C++ library because it uses XML for the .ui files - the designer forms? Surely not. Does it stray from C++ by providing reflection, meta type information and other goodies through the meta object compiler (the moc), surely not. Those are just tools for development, but they're bundled in some module (or tool) as they're critical for one task or another. QML is no different, it's just like the .ui files the designer gives you, only the syntax is different (leaving the actual implementation aside).
Or even more straightforwardly: Does it mean Qt's not a C++ library/framework if it exposes python or java bindings?
What you mean by "a pure C++ library" Qt hasn't been from its earliest days. Practically forever Qt has been using a combination of macros, auto generating and pre-compiling C++ code (moc), XML files (widgets' ui files), its own build (qmake) and documentation (qdoc) systems to provide additional functionality and extend the (C++) language where it's been lacking - Qt has had reflection, meta object information, dynamic properties and more, way back; before it was even conceived adding it to the C++ standard. This mixing and matching is neither new, nor unexpected, so I don't really understand your point with QML. -
@kshegunov said in Qt is changing from C++ library to QML library... with KDAB:
This mixing and matching is neither new, nor unexpected, so I don't really understand your point with QML.
Yes, I can see how that is not clear. My perspective was from the eyes of young people that are not familiar with Qt. Students that open QtCreator for the first time, ask me if this is not a C++ library, because they find themselves reading about QML to follow the examples on how to create window etc.
When they are using Visual Basic, they are reading up on VB code, how to create user interfaces etc. but when using Qt they are not reading up on C++ but QML, and get confused about what Qt really is.
I think it is hard for experienced users of Qt to understand this perspective, because it all makes to much sence for you to be able to see how it looks for people that do not have all the pieces of the pussle that you have.
This is why I think there is a difference in how the marketing is perceived by people familiar with Qt and advanced development in C++ and people that are toatally new to programming.
Qt just does not look the same to these two groups of people it seems like.
-
@A.K.G. said in Qt is changing from C++ library to QML library... with KDAB:
When they are using Visual Basic, they are reading up on VB code, how to create user interfaces etc. but when using Qt they are not reading up on C++ but QML, and get confused about what Qt really is.
Then perhaps you or whoever their teacher is should start with introducing them to the widgets module, which has no connection to QML and can be used with C++ exclusively ... See, QML isn't a requirement (still), it's an option.
-
@kshegunov said in Qt is changing from C++ library to QML library... with KDAB:
@A.K.G. said in Qt is changing from C++ library to QML library... with KDAB:
When they are using Visual Basic, they are reading up on VB code, how to create user interfaces etc. but when using Qt they are not reading up on C++ but QML, and get confused about what Qt really is.
Then perhaps you or whoever their teacher is should start with introducing them to the widgets module, which has no connection to QML and can be used with C++ exclusively ... See, QML isn't a requirement (still), it's an option.
Yes, that is what we are doing. The problem arise when they open QtCreator on their own to play around with the examples. Many of them get confused on what Qt is, and many think that we are using Qt even though it is actually intended for something called QML and not C++
They normally go to Wikipedia where you can read the following on QML:
QML (Qt Meta Language or Qt Modeling Language) is a user interface markup language. It is a JSON-like declarative language for designing user interface–centric applications. Inline JavaScript code handles imperative aspects. It is part of Qt Quick, the UI creation kit developed by Nokia within the Qt framework.
After the last line above, they conclude that you create UI in Qt framework with Qt Quick. A few are even surprised that we can use widgets, as they think that all UI is done in QML.
Now again, this is the perspective these students have. They connect Qt with a language developed by Nokia that is called QML, that is part of Qt Quick, that is the Qt framework - that we use to create user interfaces.
The comment about C++, on the same page sounds like C++ is an optional path:
Elements can also be seamlessly integrated and extended by C++ components using the Qt framework.It sounds like the main used is QML and Javacript, and in the end they mention that elements can also be integrated and extended by C++.
Some then ask if we can not use a framework that is more directed towards only C++, instead of using Qt.
So in the mind of most of these students, Qt is about QML and Javascript, to make user interfaces for mobile phones. They arrive at this conclusion, starting with the example list in QtCreator, going through articles for example on Wikipedia about QML. They are missing the point totally, that Qt is a C++ framework, that mostly has been used for business application with widgets in pure C++.
I hear that most of you reading and replying to this topic, does not see it this way, but I have to conclude at the end, that I understand why the students see it this way. I also wish Qt Company and partners like KDAB would clean this up in their marketing, because it really is having an effect on how newcomers look at what Qt really is.
-
Many of them get confused on what Qt is, and many think that we are using Qt even though it is actually intended for something called QML and not C++
You can redirect them to Qt's wikipedia page, where it's written:
Qt uses standard C++ with extensions including signals and slots that simplify handling of events, and this helps in development of both GUI and server applications which receive their own set of event information and should process them accordingly. Qt supports many compilers, including the GCC C++ compiler and the Visual Studio suite.
and continues on to explain what QML is:
Qt also provides Qt Quick, that includes a declarative scripting language called QML that allows using JavaScript to provide the logic. With Qt Quick, rapid application development for mobile devices became possible, although logic can be written with native code as well to achieve the best possible performance.
Should be that simple.