Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Portuguese
  4. QProcess e scanimage (Linux) funcionam juntos ?
Forum Updated to NodeBB v4.3 + New Features

QProcess e scanimage (Linux) funcionam juntos ?

Scheduled Pinned Locked Moved Solved Portuguese
2 Posts 1 Posters 1.1k 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.
  • cvitaglianoC Offline
    cvitaglianoC Offline
    cvitagliano
    wrote on last edited by
    #1

    Estou tentando fazer funcionar a classe QProcess com o aplicativo scanimage para digitalizar documentos que estão em papel. O meu scanner é um Canon CanoScan.
    Já tentei várias maneiras, mas a instrução START do QProcess faz que funciona, mas não aciona o scanner.

    Alguém tem alguma dica ?

    void ClasseScanner::on_pbScanDOC_clicked() {
    QString tipo_os = QSysInfo::productType();

    QString pasta_arquivo = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
    pasta_arquivo.append("/docto_scan.tif");
    
    QString comando = "scanimage -l 0 -t 0 -x 90 -y 220 --mode Color --resolution 150 --brightness 0 --contrast 0 --format=tiff > ";
    comando.append(pasta_arquivo);
    
    if ( tipo_os.compare("ubuntu") == 0 ) {
        processo = new QProcess(this);
        processo->start(comando);
    
        if (!processo->waitForFinished(-1)) qDebug() << "Falhou: " << processo->errorString();
        else qDebug() << "OK " << processo->readAll();
    }
    

    }

    1 Reply Last reply
    0
    • cvitaglianoC Offline
      cvitaglianoC Offline
      cvitagliano
      wrote on last edited by
      #2

      A solução está em https://forum.qt.io/topic/91802/qprocess-and-scanimage-linux

      1 Reply Last reply
      1

      • Login

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