#include "widget.h"
#include "ui_widget.h"
#include<QtGui>
ui(new Ui::Widget)
{
QString program
= "/home/digital_images/Desktop/zipfile.zip.gz";
//path to zip file connect (myProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(printOut()));
connect (myProcess, SIGNAL(readyReadStandardError()), this, SLOT(printError()));
myProcess->start(program, arguments);
myProcess->waitForFinished();
ui->setupUi(this);
}
Widget::~Widget()
{
delete ui;
}
void Widget::printOut()
{
QByteArray byteArray
= myProcess
->readAllStandardOutput
();
{
qDebug()<<line<<"Outputline";
}
}
void Widget::printError()
{
QByteArray byteArray
= myProcess
->readAllStandardError
();
{
qDebug()<<"Errorline"<<line;
}
}
#include "widget.h"
#include "ui_widget.h"
#include<QtGui>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
QString program = "/home/digital_images/Desktop/zipfile.zip.gz";//path to zip file
QStringList arguments;
myProcess = new QProcess(this);
connect (myProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(printOut()));
connect (myProcess, SIGNAL(readyReadStandardError()), this, SLOT(printError()));
myProcess->start(program, arguments);
myProcess->waitForFinished();
ui->setupUi(this);
}
Widget::~Widget()
{
delete ui;
}
void Widget::printOut()
{
QByteArray byteArray = myProcess->readAllStandardOutput();
QStringList strLines = QString(byteArray).split("\n");
foreach (QString line, strLines)
{
qDebug()<<line<<"Outputline";
}
}
void Widget::printError()
{
QByteArray byteArray = myProcess->readAllStandardError();
QStringList strLines = QString(byteArray).split("\n");
foreach (QString line, strLines)
{
qDebug()<<"Errorline"<<line;
}
}
To copy to clipboard, switch view to plain text mode
what am doing wrong please guide me
Bookmarks