Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Call method to create file c++
QtWS25 Last Chance

Call method to create file c++

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 426 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Caio.Sousa
    wrote on last edited by Caio.Sousa
    #1

    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

    gfxxG K 2 Replies Last reply
    0
    • C 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

      gfxxG Offline
      gfxxG Offline
      gfxx
      wrote on last edited by
      #2

      @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

      bkt

      1 Reply Last reply
      0
      • C 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

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        @Caio.Sousa

        Basically 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.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved