rendered paste body// 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 <QApplication>
#include <QtGui>
#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<QObject*>(form.pushButton),&app);
widget->show();
return app.exec();
}
// fecha.cpp
#include <QApplication>
#include "fecha.h"
FecharApp::FecharApp( )
{
public:
static void fechar( QObject *elemento ,QObject *app){
QObject::connect(elemento, SIGNAL(clicked()), app, SLOT(quit()));
}
};
// fecha.h
#include <QApplication>
class FecharApp
{
public:
static void fechar( QObject*, QObject* );
};