Call method to create file c++
-
wrote on 21 Oct 2018, 18:48 last edited by Caio.Sousa
Hello everyone,
A simple question, to use the file in QT, can I use the QT libraries, or can I use the C ++ library (FIle *) in other class, and only call the function to create the file in QT class,exemple in a click event;
Example.
void login::on_btnConfim_clicked()
{
Archive arch;
Person * p = new person ();
QString name = ui->txtName->text();
QString number = ui->txtNumber->text();
p-> setNome (name);
p-> setNumber (number);
arch.create (p-> getName (), p-> getNumber);}
In this example the create method receives the variables from the person object to create the file
-
Hello everyone,
A simple question, to use the file in QT, can I use the QT libraries, or can I use the C ++ library (FIle *) in other class, and only call the function to create the file in QT class,exemple in a click event;
Example.
void login::on_btnConfim_clicked()
{
Archive arch;
Person * p = new person ();
QString name = ui->txtName->text();
QString number = ui->txtNumber->text();
p-> setNome (name);
p-> setNumber (number);
arch.create (p-> getName (), p-> getNumber);}
In this example the create method receives the variables from the person object to create the file
wrote on 21 Oct 2018, 19:28 last edited by@Caio.Sousa really not understand very well the question ... but you can use qt class or std::customYourClass at the same time in every part of your project ...
regards
giorgio -
Hello everyone,
A simple question, to use the file in QT, can I use the QT libraries, or can I use the C ++ library (FIle *) in other class, and only call the function to create the file in QT class,exemple in a click event;
Example.
void login::on_btnConfim_clicked()
{
Archive arch;
Person * p = new person ();
QString name = ui->txtName->text();
QString number = ui->txtNumber->text();
p-> setNome (name);
p-> setNumber (number);
arch.create (p-> getName (), p-> getNumber);}
In this example the create method receives the variables from the person object to create the file
wrote on 21 Oct 2018, 19:29 last edited byBasically you can use what your preference is. Pick the parts of Qt you like and C/C++ and/or stl and/or even further libraries.
I use for instance stl containers and boost shared_ptr (now part std as well), because I am used to them.
3/3