Re: Problem With findchild()
Hi, findChild() uses the object name of a QObject, not the name of the variable where you store your pointer. So I guess in your case "label" is always NULL, and that's why the program crashes. Use setObjectName() when you create your label in the menuprocess-constructor.
Ginsengelf
Re: Problem With findchild()
Quote:
Originally Posted by
gunturrohith
The program has unexpectedly finished
Meaning it crashed.
You should have gotten a stack trace when running this in a debugger.
Quote:
Originally Posted by
gunturrohith
Here is my Code:
Don't write that when the code is not actually your code.
Quote:
Originally Posted by
gunturrohith
Is it possible todo so in this manner if yes
Yes, this is possible, as Ginsengelf already wrote.
However, what do you need this for?
Why not just store the widgets you need access to in a way to allows you to access them directly?
Cheers,
_
Re: Problem With findchild()
Quote:
Don't write that when the code is not actually your code.
Hi anda_soka,
Thanks for replying and helping and apologies for asking explanation,may i know the reason behind for stating this sentence
Don't write that when the code is not actually your code. I may not be a great programmer in Qt but all the lines i have written on my own by considering the Qt assistant as reference.
Thanks in advance,
Rohith.G
Re: Problem With findchild()
Hi, anda_skoa probably meant that your code won't compile the way you posted it and this means that it is not your complete code. For example i and j are undeclared in menuprocess::tester()
Ginsengelf
Re: Problem With findchild()
Quote:
Originally Posted by
Ginsengelf
Hi, anda_skoa probably meant that your code won't compile the way you posted it and this means that it is not your complete code.
Exactly!
Cheers,
_