[Qt-interest] Fwd: concatenate some files

mierdatutis mi mmm286 at gmail.com
Wed Jul 22 19:49:41 CEST 2009


---------- Forwarded message ----------
From: mierdatutis mi <mmm286 at gmail.com>
Date: 2009/7/22
Subject: Re: [Qt-interest] concatenate some files
To: "Nechypurenko, Andrey (GE Healthcare)" <Andrey.Nechypurenko at ge.com>




Well I do a shell script, and I would like to get the output of the shell
script to filling the progress bar.
I try to execute the script with qprocess but it gives me an warning of
"Cannot access memory address 0x..."

Could you help me?
I write the code:

MainWindowImpl::MainWindowImpl( QWidget * parent, Qt::WFlags f)

: QMainWindow(parent, f)

{

setupUi(this);

proc2 = new QProcess( this );

//proc2->start("/home/david/pruebas/grabadas/kk.sh", QStringList() );

  QByteArray result=proc2->readAllStandardOutput();

qDebug() << proc2->readAllStandardOutput();

QStringList lines = QString(result).split("\n");

foreach (QString line, lines) {

texto->append(line);

}

}


#ifndef MAINWINDOWIMPL_H

#define MAINWINDOWIMPL_H

#include <QProcess>

#include <QProgressDialog>

#include <QMainWindow>

#include "ui_mainwindow.h"

//

class MainWindowImpl : public QMainWindow, public Ui::MainWindow

{

Q_OBJECT

public:

MainWindowImpl( QWidget * parent = 0, Qt::WFlags f = 0 );

 //void salida();

//void empieza();

private:

QProcess *proc2;

QProgressDialog *progress;

};


#include <QApplication>

#include "mainwindowimpl.h"

#include <QProcess>

//

int main(int argc, char ** argv)

{

QApplication app( argc, argv );

MainWindowImpl win;

win.show();

app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );

return app.exec();

 }



Any help?
Many thanks and sorry for my english!

2009/7/21 Nechypurenko, Andrey (GE Healthcare) <Andrey.Nechypurenko at ge.com>

Hi,
>
> > I would like to concatenate all files of a directory with
> > extension TS and I would like to show a progress bar while
> > the files are joining.
> > Could you say me how could I do this with qt?
>
> Forget about Qt for the beginning and try to write down steps required
> to solve your task using whatever language you like (not a programming
> language). For example something along this line:
>
> 1. Create empty destination file
> 2. For each file with extension "TS" do:
> 3.   Until end of file reached
> 4.     read N bytes from file
> 5.     write these bytes to the destination file
>
>  .... And so on.
>
> As soon as you are ready with this task, browse Qt documentation to find
> out how to implement each particular step. Oliver already gave you some
> hints.
>
> HTH,
> Andrey.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090722/aa22fb3b/attachment.html 


More information about the Qt-interest-old mailing list