这两天要用qt做一个界面,但主体功能用要用c语言实现,于是,把c语言的代码生成动态库,在Qt里动态加载该库,拿出来大家分享分享!,
下面是我的QT源码!
main.h文件
2 #define MAIN_WINDOW
3 #include<QtGui>
4 #include<QTextEdit>
5
6 using namespace std;
7 QString s2q(const string &s);
8 string q2s(const QString &s);
9
10 class MainWindow : public QMainWindow
11 {
12 Q_OBJECT
13
14 public:
15 explicit MainWindow(QWidget *parent = 0);
16 virtual ~MainWindow();
17
18 private slots:
19 void handleButton();
20 void clear_send_box();
21 void clear_rev_box();
22 void my_show();
23
24 private:
25 QWidget *Window;
26 QPushButton *send_clear;
27 QPushButton *receive_clear;
28 QPushButton *send;
29 QPushButton *receive;
30 QTextEdit *input;
31