#include #include #include "ui_interface.h" #include using namespace std; class FechaApp { public: void fechar(char elemento){ // da erro aqui QObject::connect(elemento, SIGNAL(clicked()), QApplication, SLOT(quit())); } } int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow *widget = new QMainWindow(); Ui::MainWindow form; form.setupUi(widget); //form.setupUi(); Fechar x; x.fechar(form.pushButton); //QObject::connect(form.pushButton, SIGNAL(clicked()), &app, SLOT(quit())); widget->show(); return app.exec(); } C:\teste\financeiro\main.cpp||In member function `void FechaApp::fechar(std::string)':| C:\teste\financeiro\main.cpp|10|error: expected primary-expression before ',' token| C:\teste\financeiro\main.cpp|16|error: new types may not be defined in a return type| C:\teste\financeiro\main.cpp|16|note: (perhaps a semicolon is missing after the definition of `FechaApp')| C:\teste\financeiro\main.cpp|16|error: extraneous `int' ignored| C:\teste\financeiro\main.cpp|16|error: `main' must return `int'| C:\teste\financeiro\main.cpp|16|error: return type for `main' changed to `int'| C:\teste\financeiro\main.cpp||In function `int main(...)':| C:\teste\financeiro\main.cpp|25|error: `Fechar' was not declared in this scope| C:\teste\financeiro\main.cpp|25|error: expected `;' before "x"| C:\teste\financeiro\main.cpp|26|error: `x' was not declared in this scope| C:\teste\financeiro\main.cpp|25|warning: unused variable 'Fechar'| C:\teste\financeiro\main.cpp|26|warning: unused variable 'x'| ||=== Build finished: 8 errors, 2 warnings ===|