qml file:
onClicked:
{
Sender.address = "udpm://239.255.76.67:7687"
Sender.ttl= 0
Sender.channel= "A"
Sender.data= "ddfdsf"
Sender.sendData()
}
onClicked:
{
Sender.address = "udpm://239.255.76.67:7687"
Sender.ttl= 0
Sender.channel= "A"
Sender.data= "ddfdsf"
Sender.sendData()
}
To copy to clipboard, switch view to plain text mode
.h file:
Q_INVOKABLE void sendData ();
Q_INVOKABLE void sendData ();
To copy to clipboard, switch view to plain text mode
main.cpp file:
int main (int argc, char *argv[])
{
QGuiApplication app(argc, argv);
const char* ocuui = "OCUUI"; // @uri OCUUI
qmlRegisterType <Sender> (ocuui, 1, 0, "Sender");
Sender objS;
objS.sendData ();
QtQuick2ApplicationViewer viewer;
viewer.addImportPath("/home....");
viewer.setMainQmlFile(QStringLiteral("..../main.qml"));
viewer.showExpanded();
return app.exec();
}
int main (int argc, char *argv[])
{
QGuiApplication app(argc, argv);
const char* ocuui = "OCUUI"; // @uri OCUUI
qmlRegisterType <Sender> (ocuui, 1, 0, "Sender");
Sender objS;
objS.sendData ();
QtQuick2ApplicationViewer viewer;
viewer.addImportPath("/home....");
viewer.setMainQmlFile(QStringLiteral("..../main.qml"));
viewer.showExpanded();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I am using QtCreator. The thing I find odd is that when I type
Sender.
Sender.
To copy to clipboard, switch view to plain text mode
it shows a list of the members of that class and that list "contains" sendData function.
What point am I missing? Yes, sendData has been defined in the corresponding .cpp file.
Bookmarks