[Solved]Get text of a button
-
Hi guys,
I wonder if there is a way to get the text of a button.
E.g. some functions like:
@QPushButton *button = new QPushButton("Test");
QString temp = button->getName();@Thanks a lot in advance!
BR
-
Hi,
what about:
@
QPushButton* btn = new QPushButton("MyButton");
qDebug() << "Text:" << btn->text();
@BR
-
Hi,
You can retrieve the button's text via QPushButton::text(), as such:
@button->text();@ -
Hi,
very kind of you! Many thanks!
BR