How do I create a custom slot in qt4 designer?

前端 未结 10 590
我在风中等你
我在风中等你 2020-12-14 18:29

Whenever I use the signal/slot editor dialog box, I have to choose from the existing list of slots. So the question is how do I create a custom named slot?

10条回答
  •  孤街浪徒
    2020-12-14 18:40

    I am able to do it by:

    In MainWindow.h, add the line:

    public slots:
         void example();
    

    in the MainWindow class.

    In MainWindow.cpp

    void MainWindow::example() {
         
    }
    

提交回复
热议问题