vladimirek / libmaia Goto Github PK
View Code? Open in Web Editor NEWThis project forked from wiedi/libmaia
XML-RPC lib for Qt4
License: Other
This project forked from wiedi/libmaia
XML-RPC lib for Qt4
License: Other
about libmaia ------------- libmaia is a easy-to-use XML-RCP library for Qt4! compiling libmaia ----------------- # qmake # make Qt Datatypes ------------ Allowed types for Argument and Return Values: C++/Qt-Types XMLRPC-Types ---------------------------------------- * int <int></int> * bool <bool></bool> * double <double></double> * QString <string></string> * QDateTime <datetime.iso8601></datetime.iso8601> * ByteArray <base64></base64> * QVariantMap <struct></struct> * QVariantList <array></array> using libmaia ------------- 1) qmake: your Project file (.pro) should contain ==================================== INCLUDEPATH += /path/to/libmaia LIBS += /path/to/libmaia/libmaia.a QT += xml network ==================================== 2) in your header file include #include "maiaXmlRpcClient.h" AND/OR #include "maiaXmlRpcServer.h" 4) create object server: MaiaXmlRpcServer *server = new MaiaXmlRpcServer(8080, this); client: MaiaXmlRpcClient *client = new MaiaXmlRpcClient(QUrl("http://localhost:8080/RPC2"), this); 5) register a method your method has to be a Qt Slot. // example method: QString MyClass::myMethod(int param1, QString param2) { if(param1 > 5) return param2; else return "not bigger than 5"; } // register it: // "example.methodName" <- used to identify the method over xml-rpc // this <- pointer to the class which contains the method you would export // "myMethod" the name of the method server->addMethod("example.methodName", this, "myMethod"); 6) call a method when calling a method you need three things: 1) a Slot for the MethodResponse 2) a Slot for the FaultResponse 3) a QVariantList containig the arguments for the RPC-Method void MyClientClass::myResponseMethod(QVariant &arg) { // do something with the arg } void MyClientClass::myFaultResponse(int error, const QString &message) { qDebug() << "An Error occoured, Code: " << error << " Message: " << message; } QVariantList args; args << 5; args << "this is a string, no, not what you think :>"; rpcClient->call("example.methodName", args, this, SLOT(myResponseMethod(QVariant&)), this, SLOT(myFaultResponse(int, const QString &)));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.