Qt 信号如何自动连接槽函数?

on_objectName_signal

[static] void QMetaObject::connectSlotsByName(QObject *object)
void on_<object name>_<signal name>(<signal parameters>);

eg.
void on_button1_clicked();

QMetaObject::connectSlotsByName(this);
//执行上面一个语句就会去连接 this 对象中的信号和槽


原文地址:https://www.cnblogs.com/cheungxiongwei/p/8093355.html