16,211
社区成员
发帖
与我相关
我的任务
分享
#include "ff.h"
#include <QtGui/QApplication>
#include "../FFDLL/ffdll.h"
#pragma comment(lib, "../Test/FFDLL.lib")
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
FF w;
w.show();
//动态库中的UI类
FFDLL dll;
dll.show();
return a.exec();
}
//ff.h
#ifndef FF_H
#define FF_H
#include <QtGui/QMainWindow>
#include "ui_ff.h"
class FF : public QMainWindow
{
Q_OBJECT
public:
FF(QWidget *parent = 0, Qt::WFlags flags = 0);
~FF();
private:
Ui::FFClass ui;
};
#endif // FF_H
//ff.cpp
#include "ff.h"
FF::FF(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
}
FF::~FF()
{
}
//ffdll_global.h
#ifndef FFDLL_GLOBAL_H
#define FFDLL_GLOBAL_H
#include <QtCore/qglobal.h>
#ifdef FFDLL_LIB
# define FFDLL_EXPORT Q_DECL_EXPORT
#else
# define FFDLL_EXPORT Q_DECL_IMPORT
#endif
#endif // FFDLL_GLOBAL_H
//ffdll.h
#ifndef FFDLL_H
#define FFDLL_H
#include <QtGui/QWidget>
#include "ffdll_global.h"
class FFDLL_EXPORT FFDLL:public QWidget
{
public:
FFDLL();
~FFDLL();
private:
};
#endif // FFDLL_H
//ffdll.cpp
#include "ffdll.h"
FFDLL::FFDLL()
{
}
FFDLL::~FFDLL()
{
}
#include "ff.h"
#include <QtGui/QApplication>
#include "../FFDLL/ffdll.h"
#pragma comment(lib, "../Test/FFDLL.lib")
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
FF w;
w.show();
//DLL中界面
FFDLL dll;
dll.show();
return a.exec();
}