My GUI class in constructor is creating new object of my database class. It looks like that:
GUI::GUI(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); Baza *plik = new Baza(); connect(ui.insertBtn, &QPushButton::clicked, this, &GUI::run); } I've managed to get user input from QDialog:
void GUI::run() { DialogInput dialog; dialog.exec(); site_text = dialog.getSite(); } How should I pass site_text to function in Baza class? I need to use that object (plik) created in GUI constructor but I can't access it from GUI::run() function.