after reading and doing several testing i found out answers in my questions...
how to export class functions...
mydll.h
#define MYDLLEXPORT Q_DECL_EXPORT
#ifndef MYDLL_H
#define MYDLL_H
#include "ui_your_ui.h // if you have used ui in your class
class your_class //some codes
{
//some codes
class_function();
}
extern "C" {
MYDLLEXPORT void showqt();
...
..
}
#endif
#define MYDLLEXPORT Q_DECL_EXPORT
#ifndef MYDLL_H
#define MYDLL_H
#include "ui_your_ui.h // if you have used ui in your class
class your_class //some codes
{
//some codes
class_function();
}
extern "C" {
MYDLLEXPORT void showqt();
...
..
}
#endif
To copy to clipboard, switch view to plain text mode
your_class.cpp
#include mydll.h
class::class
{
//some lines.........
}
class::class_fuction()
{
//some lines..........
}
#include mydll.h
class::class
{
//some lines.........
}
class::class_fuction()
{
//some lines..........
}
To copy to clipboard, switch view to plain text mode
mydll.cpp
#include <QApplication>
#include "mydll.h"
int main()
{
}
void showqt()
{
char ** argv;
int argc=1;
your_class accessclass;//this should be under the QApplication or paint event
acessclass.class_function(); //to access the class functions
return;
}
#include <QApplication>
#include "mydll.h"
int main()
{
}
void showqt()
{
char ** argv;
int argc=1;
QApplication lib(argc,argv);
your_class accessclass;//this should be under the QApplication or paint event
acessclass.class_function(); //to access the class functions
return;
}
To copy to clipboard, switch view to plain text mode
the point here is to access the class::function to exported function
and lastly to access the functions with parameter depends on how you imported the function....
if you have suggestions on how can i improve my program, you are free to comment..
Bookmarks