HI
I am pretty new plz tell me how i overcome this memory leak plz ?????
i correct button2Pushed
plz help
No error but no ouput on analyze dialog when i press push button 2 frombinary
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( button2Pushed
( const QString & ) ), myAnalyze,
SLOT( onButton2Push
( const QString & ) ) );
}
void binary::text()
{
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( button2Pushed( const QString & ) ), myAnalyze, SLOT( onButton2Push( const QString & ) ) );
}
void binary::text()
{
QString set= "hello";
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
Bookmarks