Hi,
Sorry for my bad english and sorry for my bad level in qt.
I would like to use a qml program and c++ libraries (with import).
I use Visual Studio on windows.
I have several problems (and I put an example here-after) :
- how to use c++ with qml
- how to use a library written in c++ to use in a program in QML with
IMPORT statement.
- how to build executable and librarie with cmake?
My example is here :
main.qml
import QtQuick 2.15
import QtQuick.Controls 2.15
// import calculator ? ? ? how ?
#include "calculator.cpp"
int main(int argc, char* argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<Calculator>("Calculator", 1, 0, "Calculator");
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject* obj, const QUrl& objUrl) {
if (!obj && url == objUrl)