Hello
I have the following class:
Code:
class Motorista() { protected: string name; //or char* name; string idade; public: void insertMotorista(string _name, string _idade) { name = _name; idade = _idade; QSqlQuery query; query.exec("INSERT INTO motorista (nome, id)" "VALUES ('name', 'idade')"); } }
I also have a class Ui_Moto:
Now I want to use the QLineEdit constructor of the class Motorista:
Code:
void Ui_moto::cad() { Motorista* moto = new Motorista(); moto->insertMotorista(name2, idade2); // (LineEdit *name2, QLineEdit *idade2) }
In other words, what I'm wanting is to put parameters in the data that the User writes in the form to register a Motorista.
Can be done?
Thx