#ifndef MYWIDGET2_H #define MYWIDGET2_H #include #include #include // 单行输入框 #include class MyWidget2 : public QWidget { Q_OBJECT public: explicit MyWidget2(QWidget *parent = nullptr); public: void getText(); // 自定义成员函数 private: QPushButton *mBtn; QLineEdit *mEdit; signals: }; #endif // MYWIDGET2_H