💢💢目录总览💢💢:QT基础入门目录总览
当在QT中使用信号槽的时候结果突然报错,可能是这个类没有继承QObject类
error: no matching function for call to 'MainWindow::connect
error: no type named 'Object' in 'struct
error: no type named 'type' in 'struct std::enable_if
error: no type named 'Object' in 'struct QtPrivate::FunctionPointer<const char*>'
一、原因
Qt 的槽函数机制是建立在 QObject 类的基础上的。因此,为了能够使用 Qt 的信号与槽机制,自定义类需要继承自 QObject。
相关问题: