[Qt-interest] qprocess related with qprogressbar

Sean Harmer sean.harmer at maps-technology.com
Fri Jun 26 10:04:10 CEST 2009


Hi Again,

On Friday 26 Jun 2009 06:45:08 mierdatutis mi wrote:
> I try with this code but the compiler gives me an error:
>
> "Program received signal SIGSERV. Segmentation fault"
Just spotted the error...

> class MainWindowImpl : public QMainWindow, public Ui::MainWindow
> {
> Q_OBJECT
> public:
> MainWindowImpl( QWidget * parent = 0, Qt::WFlags f = 0 );
>
> private slots:
> void cambio(QListWidgetItem*);
> void salida();
> public slots:
> void doSomething();
> private:
> QProcess *proc2;
You declare proc2 here...
<snip>
>  MainWindowImpl::MainWindowImpl( QWidget * parent, Qt::WFlags f)
> : QMainWindow(parent, f)
> {
> setupUi(this);
> QDir dir;
> //showFullScreen();
> QProcess *proc2 = new QProcess();
And then hide the proc2 that you declared earlier. This should be:
proc2 = new QProcess( this );

With your original code the member variable proc2 never gets set to point at a 
valid memory address.

I respectfully suggest that you go read some books on basic C++ programming 
and general development processes. Once you understand basic C++ take a look 
at the Qt tutorials and examples included in the distribution.

All the best,

Sean



More information about the Qt-interest-old mailing list