i got following error
binary.h
#ifndef BINARY_H
#define BINARY_H
#include <QMainWindow>
#include"analyze.h"
namespace Ui {
class binary;
}
{
Q_OBJECT
public:
explicit binary
(QWidget *parent
= 0);
~binary();
public slots:
void openAnalyze();
public slots:
void text();
signals:
void button2Pushed
( const QString & text
);
private:
Analyze *myAnalyze;
private:
Ui::binary *ui;
};
#endif // BINARY_H
#ifndef BINARY_H
#define BINARY_H
#include <QMainWindow>
#include"analyze.h"
namespace Ui {
class binary;
}
class binary : public QMainWindow
{
Q_OBJECT
public:
explicit binary(QWidget *parent = 0);
~binary();
public slots:
void openAnalyze();
public slots:
void text();
signals:
void button2Pushed( const QString & text );
private:
Analyze *myAnalyze;
private:
Ui::binary *ui;
};
#endif // BINARY_H
To copy to clipboard, switch view to plain text mode
binary.cpp
#include "binary.h"
#include "ui_binary.h"
#include "ui_analyze.h"
ui(new Ui::binary)
{
ui->setupUi(this);
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(openAnalyze()));
connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(text()));
}
void binary::openAnalyze()
{
myAnalyze= new Analyze();
myAnalyze->show();
connect( this,
SIGNAL( onButton2Push
( const QString & ) ), myAnalyze,
SLOT( onButton2Push
( const QString & ) ) );
}
void binary::text()
{
ui->lineEdit->setText(set);
emit button2Pushed( set );
}
binary::~binary()
{
delete ui;
}
#include "binary.h"
#include "ui_binary.h"
#include "ui_analyze.h"
binary::binary(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::binary)
{
ui->setupUi(this);
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(openAnalyze()));
connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(text()));
}
void binary::openAnalyze()
{
myAnalyze= new Analyze();
myAnalyze->show();
connect( this, SIGNAL( onButton2Push( const QString & ) ), myAnalyze, SLOT( onButton2Push( const QString & ) ) );
}
void binary::text()
{
QString set= "hello";
ui->lineEdit->setText(set);
emit button2Pushed( set );
}
binary::~binary()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
analyze.h
#ifndef ANALYZE_H
#define ANALYZE_H
#include <QDialog>
namespace Ui {
class Analyze;
}
{
Q_OBJECT
public:
explicit Analyze
(QWidget *parent
= 0);
~Analyze();
public slots:
void onButton2Push
( const QString & text
);
private:
Ui::Analyze *ui;
};
#endif // ANALYZE_H
#ifndef ANALYZE_H
#define ANALYZE_H
#include <QDialog>
namespace Ui {
class Analyze;
}
class Analyze : public QDialog
{
Q_OBJECT
public:
explicit Analyze(QWidget *parent = 0);
~Analyze();
public slots:
void onButton2Push( const QString & text );
private:
Ui::Analyze *ui;
};
#endif // ANALYZE_H
To copy to clipboard, switch view to plain text mode
analyze.cpp
#include "analyze.h"
#include "ui_analyze.h"
Analyze
::Analyze(QWidget *parent
) : ui(new Ui::Analyze)
{
ui->setupUi(this);
}
void Analyze
::onButton2Push( const QString & text
) {
}
Analyze::~Analyze()
{
delete ui;
}
#include "analyze.h"
#include "ui_analyze.h"
Analyze::Analyze(QWidget *parent) :
QDialog(parent),
ui(new Ui::Analyze)
{
ui->setupUi(this);
}
void Analyze::onButton2Push( const QString & text )
{
}
Analyze::~Analyze()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
i gott following error plz help
starting /home/nawazbaig/BinaryAnalyzer-build-desktop-Qt_4_8_1_in_PATH__System__Release/BinaryAnalyzer...
Object::connect: No such signal binary:nButton2Push( const QString & )
Object::connect: (sender name: 'binary')
Object::connect: (receiver name: 'Analyze')
/home/nawazbaig/BinaryAnalyzer-build-desktop-Qt_4_8_1_in_PATH__System__Release/BinaryAnalyzer exited with code 0
plz help i displayed code with changes but no result
Bookmarks