As I understand the problem is that the content of the user class is transmitted through the signal. Using Q_DECLARE_METATYPE in the class prototype produced an error. How do I transfer the data in this case?
error: no matching function for call to 'MainWindow::setMail(SetMail*&)' emit this->setMail(set); // настроить письмо ^ class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); signals: void setMail(SetMail); }; void MainWindow::on_pushButtonStart_clicked() { SetMail *set = new SetMail(this); set->provider = prov->nowProvider(); set->sender = ""; emit this->setMail(set); } int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); TransportMail *tm = new TransportMail(); QObject::connect(&w, SIGNAL(setMail(SetMail)), tm, SLOT(setMail(SetMail))); }