samedi 5 juin 2021

i wanna to a specific button of a specific widget which i have created dynamiclly with Qt [duplicate]

how can i access a specific button which i have created dynamiclly to make it do a specific function, the question is how to now this button index or path to manage to use it in a specific matter

this code show i can create a widgit with this buttons by the way my app requires more than one widget of it so there are many buttons like it how can i distinguish between them"commentbutton"

:

    QVBoxLayout*Layout=qobject_cast<QVBoxLayout*>(ui->scrollareapostsnewsfeed->layout());

    QWidget*postblock=new QWidget();

    QBoxLayout*boxlayout=new QBoxLayout(QBoxLayout::TopToBottom,postblock);

    QPushButton *commentbutton=new QPushButton("Comments");//this button

    boxlayout->insertWidget(0,commentbutton);

     postblock->setLayout(boxlayout);


Aucun commentaire:

Enregistrer un commentaire