QtExamples/DbSigSlot/main.cpp
xmuli f9e224204d feat: signal and slot principles; and moc principles (what is done)
signal 和 slot 原理;以及 moc 原理(做了什么内容)
2021-05-10 00:25:40 +08:00

20 lines
553 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <iostream>
#include "object.h"
using namespace std;
// 目的:自行构造 moc 编译器,手动将 object.h --> db_bject.cpp (宏 和 moc 编译器处理的部分)
// 时间2021-003-26
// 作者:偕臧 ifmet.cn
// 下载https://github.com/xmuli/QtExamples
// 参考https://blog.csdn.net/perfectguyipeng/article/details/78082360
int main(int argc, char *argv[])
{
Object *obj1 = new Object();
Object *obj2 = new Object();
Object::db_connet(obj1, "sig1()", obj2, "slot1()");
obj1->testSignal();
return 0;
}