QT manually trigger a slot function

QT manually trigger a slot function

When adding a slot function to the controls of the ui interface, you can add it directly by right-clicking, and you will not see the connect function in the constructor, but the linear signal will be sent and realized.
What if we need to use this slot function elsewhere.

1. Just use the emit keyword to create a signal

signals:

    void returnPressed();    //手动调用条码框的回车槽函数

//构造函数
connect(this,SIGNAL(returnPressed()

Guess you like

Origin blog.csdn.net/qq_45646951/article/details/108851745