I would like to take result from object of struct.
allitems.h
#ifndef ALLITEMS_H
#define ALLITEMS_H
#include <QString>
class allitems
{
public:
allitems();
struct magazalar{
QString rev;
}kfc;
};
#endif // ALLITEMS_H
item.cpp
#include "allitems.h"
allitems::allitems()
{
kfc.rev="2";
}
now I would like to take result of kfc.rev from another cpp file
void MainWindow::clicked(){
allitems aaa;
QPushButton *xx=(QPushButton *)sender();
//xx->objectName() returns "kfc"
qDebug()<<aaa.(xx->objectName()).rev;
}
I would like to call kfc.rev with clicking button. when I clicked the button button objectname is kfc I can take as a result but I couldnt achieve to call struct data from button objectnames
Any idea to solve it?
katcome from?aaa.(xx->objectName()).kat.