Read commands line by line of file and send to the camera - c++ qt

Viewed 22

I need to read commands from a line-by-line file and send to the camera, (each line is a command), In C++ qt, how do I read file line by line to the end of the file, and how after that, send it by USB to the camera?

I would love help even just on my first question... Thank you :)

1 Answers

this is my code:

if (maybeSave()) {
        QString fileName = QFileDialog::getOpenFileName(this);
        if (!fileName.isEmpty())
            loadFile(fileName);

        QFile file(fileName);
         if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
             return;
         QTimer inputTimer;
         QTextStream in(&file);
         while (!in.atEnd()) {
             QString line = in.readLine();
             qDebug()<<line;
             inputTimer.start(2000);
         }
    }

i Succeeded to pasta it to the debuger, but its not wait 2 second, is anyone know why?? and also, how know, instead of that line: qDebug()<<line i send this by usb to a camera?? thanks

Related