I am using external slot to change line edit value, after connecting this slot and run my application it crash.
I am runing in this issuse from the last 4 days, I try many thinks but it doesn't work to me.
I have tow classes, one for GUI, and one for changing widget values and other things:
getdata class:
#ifndef GETDATA_H
#define GETDATA_H
#include <QObject>
#include "store.h"
class GetData
: public QObject,
private Ui
::Store{
Q_OBJECT
public:
GetData();
private slots:
void setItemCountity();
};
#endif // GETDATA_H[/QTCLASS]
#ifndef GETDATA_H
#define GETDATA_H
#include <QObject>
#include "store.h"
class QString;
class GetData : public QObject, private Ui::Store
{
Q_OBJECT
public:
GetData();
private slots:
void setItemCountity();
};
#endif // GETDATA_H[/QTCLASS]
To copy to clipboard, switch view to plain text mode
#include <QString>
#include "getdata.h"
GetData::GetData() : Ui::Store()
{
}
void GetData::setItemCountity()
{
addressWholesaleAdd->setText("dddddddd");
}
#include <QString>
#include "getdata.h"
GetData::GetData() : Ui::Store()
{
}
void GetData::setItemCountity()
{
addressWholesaleAdd->setText("dddddddd");
}
To copy to clipboard, switch view to plain text mode
store class:
#ifndef STORE_H
#define STORE_H
#include <QMainWindow>
#include "ui_store.h"
{
Q_OBJECT
public:
private:
Ui::Store ui;
private slots:
};
#endif // STORE_H
#ifndef STORE_H
#define STORE_H
#include <QMainWindow>
#include "ui_store.h"
class Store : public QMainWindow
{
Q_OBJECT
public:
Store(QWidget *parent = 0);
private:
Ui::Store ui;
private slots:
};
#endif // STORE_H
To copy to clipboard, switch view to plain text mode
#include "store.h"
#include "getdata.h"
{
ui.setupUi(this);
.
.
.
GetData *dd = new GetData;
connect(ui.addWholesaleAdd, SIGNAL(clicked()), dd, SLOT(setItemCountity()));
}
#include "store.h"
#include "getdata.h"
Store::Store(QWidget *parent) : QMainWindow(parent)
{
ui.setupUi(this);
.
.
.
GetData *dd = new GetData;
connect(ui.addWholesaleAdd, SIGNAL(clicked()), dd, SLOT(setItemCountity()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks