Need help passing a variable to another Form (Signals/Slots)
-
@jsulm
qDebug() shows me that it effectively does nothing. dialog.set_up() does not touch the object declared as opt_dia."mode: 12141696 - "
12141696 seems to be a random value.
This is the qDebug() line:qDebug() << "mode: " + QString::number(opt_dia.get_mode()) + " - " + opt_dia.get_db().userName();
@SnuggleKat Can you show the content of dialog.set_up(...)?
-
@jsulm Do you mean this?
public slots: void set_up(QSqlDatabase db, int mode){ this->db = db; this->mode = mode; emit opt_dia.send_option(db, mode);}
-
@jsulm Do you mean this?
public slots: void set_up(QSqlDatabase db, int mode){ this->db = db; this->mode = mode; emit opt_dia.send_option(db, mode);}
@SnuggleKat set_up(
public slots: void set_up(QSqlDatabase db, int mode){ this->db = db; this->mode = mode; opt_dia.set_up(db, mode); }
-
I admit, I'm a little bit out of my field here, but can you simply reassign a
QSqlDatabase
in that way?I usually pass a QSqlDatabase-pointer between classes.
-
@SnuggleKat set_up(
public slots: void set_up(QSqlDatabase db, int mode){ this->db = db; this->mode = mode; opt_dia.set_up(db, mode); }
@jsulm
Okay, it now works! Thank you.
I also hat to re-write a set_up() function inside the Dialog class.
I will clean up the way it's done by now and remember it for the next time