// erro ||=== financeiro, Release ===| C:\teste\financeiro\fecha.cpp|5|error: definition of implicitly-declared `FecharApp::FecharApp()'| C:\teste\financeiro\fecha.cpp|5|error: declaration of `FecharApp::FecharApp()' throws different exceptions| C:\teste\financeiro\fecha.h|4|error: than previous declaration `FecharApp::FecharApp() throw ()'| C:\teste\financeiro\fecha.cpp||In constructor `FecharApp::FecharApp()':| C:\teste\financeiro\fecha.cpp|6|error: expected primary-expression before "public"| C:\teste\financeiro\fecha.cpp|6|error: expected `;' before "public"| ||=== Build finished: 5 errors, 0 warnings ===| // main.cpp #include #include #include "ui_interface.h" #include "fecha.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow *widget = new QMainWindow(); Ui::MainWindow form; form.setupUi(widget); FecharApp::fechar(static_cast(form.pushButton),&app); widget->show(); return app.exec(); } // fecha.cpp #include #include "fecha.h" FecharApp::FecharApp( ) { public: static void fechar( QObject *elemento ,QObject *app){ QObject::connect(elemento, SIGNAL(clicked()), app, SLOT(quit())); } }; // fecha.h #include class FecharApp { public: static void fechar( QObject*, QObject* ); };