i=1;a[i]->setText("text");илиstring="b1";string->setText("text");
C++ (Qt)QList<QPushButton *> listButtons;QPushButton *pb = 0;for (int i= 0; i<20; ++i){ pb = new QPushButton(this); pb->setName("MyButton"+QString::number(i)); listButtons->append(pb);}
mybutton->setText("text");
list.at[i]
a[i]->setText("text")
C++ (Qt)QList<QPushButton *> list;for( int i = 0; i < 10; ++i ){ QPushButton *btn = new QPushButton( ... ); list.append( btn );} // Использованиеlist[ 3 ]->setText( .... );list.at( 7 )->setText( .... );
C++ (Qt)QMap<QSting, QPushButton*> map;map[ "Button A" ] = new QPushButton( ... );map[ "Button B" ] = new QPushButton( ... );map[ "Button C" ] = new QPushButton( ... ); // Использованиеmap[ "Button B" ]->setText( .... );
eval "obj=\"\$button1\"";obj->setText("hello, button1");
C++ (Qt)Моя_программа(){ работать();}