Find Components with function...
harry at kdevelop.org
Thu Jul 18 15:57:09 UTC 2002
On Thursday 18 July 2002 16:10, you wrote:
> I create an aplication with one per type component declared as pointer...
> QCheckBox *checkBox;
> QPushButton *pushButton;
> Into archive .cpp I use this components as...
> pushButton = new QPushButton( "Text1", this, "name1" );
> pushButton = new QPushButton( "Text2", this, "name2" );
> How I do to call the button with name "name1" in other part of my code ???
> It is possible... or I have declarate...
> QPushButton *firstButton;
> QPushButton *secondButton;
> Making bad .h archive...
It doesn't make bad .h files to store a pointer to each object you create. If
you really have a good reason to do that, you can ask the parent object for
its children using this->child( "name1" ) and casting it into a QPushButton
but this is of course much slower than using secondButton->blah().
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
More information about the KDevelop