Well I am new to Qt and especially QtQuick, so I don't know how to, f.e. make a MouseArea that will onclicked send signal to main.cpp to use a function that will return a number between 0 and 5, then print the number into a QtQuick Text field. I am trying to do something with QQmlProperty. I have smth like
QQmlApplicationEngine engine2;
QQmlEngine engine;
QQmlComponent component
(&engine,
QUrl::fromLocalFile("/home/smth/main.qml"));
QObject *object
= component.
create();
QObject *rect
= object
->findChild<QObject
*>
("applicationWindow1");
}
QApplication app(argc, argv);
QQmlApplicationEngine engine2;
QQmlEngine engine;
QQmlComponent component(&engine,QUrl::fromLocalFile("/home/smth/main.qml"));
QObject *object = component.create();
QObject *rect = object->findChild<QObject*>("applicationWindow1");
}
To copy to clipboard, switch view to plain text mode
How do I add smth like
rect->setProperty("visibility", "FullScreen");
rect->setProperty("visibility", "FullScreen");
To copy to clipboard, switch view to plain text mode
to applicationWindow1
or change a Text field in smth like.
name->setProperty("thisisthename")
name->setProperty("thisisthename")
To copy to clipboard, switch view to plain text mode
Or in any other way i need to make a connection between QML and .cpp files.
Bookmarks