There is a QStringList , there are, for example, 9 elements (in general there can be as many as you like). It is necessary to create dynamically buttons depending on the number of elements in QStringList . Each button has the name of its element in QStringList , arrange them in layout 3x3. Further, when you click on each button to process the signal in its own way. For example, when you press button 5, the line “you clicked button 5” is displayed, and by pressing button 2 , 2 variables are added and the answer is displayed in qDebug() .
Actually, one of the problems: how to fasten buttons that have not yet been created to the slots? After all, we do not know in advance how many elements in QStringList but each button should have its own command. Which is required.
QObject::connect? - user194374