Qt 6.11 is out! See what's new in the release
blog
QMessegeBox detailedText() change button label
General and Desktop
2
Posts
2
Posters
1.8k
Views
2
Watching
-
Hi, welcome to devnet.
Although it's somewhat nonstandard behavior, you can do something like this:
auto buttons = box.buttons(); auto it = std::find_if(buttons.begin(), buttons.end(), [&](QAbstractButton* btn){ return box.buttonRole(btn) == QMessageBox::ActionRole; }); if(it != buttons.end()) (*it)->setText("Foo bar");Note though that the text is set every time the button is clicked, so you might want to connect to the
clickedsignal of that button and change your text there.