Thank @SGaist . Here is the complete info if somebody requires.
Plugin Side -
First build your Qt plugin as static lib. For this place the following configuration in your plugin pro file.
CONFIG +=plugin static
My Plugin name is libDataStore.a & class name of the plugin is DataStore & Interface name is IDataStore
Inside the constructor of DataStore, set the object name
e.g this.setObjectName("DataCollectorPlugin")
libDataStore.a is present in the directory called /Users/dheeru/Qt/bins
App Side -
Place the configuration in application pro file like this
LIBS += -L/Users/dheeru/Qt/bins -lDataStore
Q_IMPORT_PLUGIN(DataStore) in main.cpp. Argument for the macro should match the classname
Use QPluginLoader::staticInstances function. This will return the QObjects list. Since there may be many plugins, objectName is useful here.
After this type cast the required object to Appropriate interface.
QObjectList objList = QPluginLoader::staticInstances();
foreach(QObject *obj1, objList){
qDebug() <<" IOS Load successful =" << obj1->objectName() << endl;
IDataStore *collector = qobject_cast<IDataStore*>(obj1);
if(collector!=NULL){
connect(this,SIGNAL(storeDB()),obj1,SLOT(start()));
}
}
Once you have object with you, rest of the process is same.