[Qt-interest] qprocess related with qprogressbar

mierdatutis mi mmm286 at gmail.com
Sun Jun 28 15:37:31 CEST 2009


Many thanks Sean,

Finally I achieved my purpose!!! Without your help and the other members was
be impossible.

Thanks a lot and see you in the mail list!!!

David.

2009/6/27 Sean Harmer <sean.harmer at maps-technology.com>

> Hi,
>
> mierdatutis mi wrote:
> > Many thanks Sean but I try to follow your instructions and it gives me
> > an error when I do progress->show(); when the process started.I do:
> <snip>
> >
> >
> > MainWindowImpl::MainWindowImpl( QWidget * parent, Qt::WFlags f)
> >
> > : QMainWindow(parent, f)
> >
> > {
> >
> > setupUi(this);
> >
> > proc2 = new QProcess( this );
> >
> > QProgressDialog *progress = new QProgressDialog( this );
> >
> This is the same type of error that you made yesterday. Do not declare
> another QProgressDialog here with the same name as you rmember as it
> hides the member variable in this scope. So your member variable is
> never getting a valid address.
>
> I recommend that you give your member variables some prefix to
> distinguish them from local variables. e.g. m_progress or m_proc.
>
> Also, be sure to initialise your member variables in the initialiser
> list of the c'tor. e.g.
>
> MainWindowImpl::MainWindowImpl( QWidget * parent, Qt::WFlags f)
>
> : QMainWindow(parent, f),
>  m_proc2( 0 ),
>  m_prgress( 0 )
>
> {
>    m_progress = new QProgressDialog( this );
>    ...
> }
>
> Again, this is basic C++ stuff really and is not specific to Qt.
>
> ATB,
>
> Sean
> _______________________________________________
> 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/20090628/d98195be/attachment.html 


More information about the Qt-interest-old mailing list