在QT中,我想比较if语句中按钮上设置的文本。如果我已经在按钮上设置文本为“停止”。使用什么方法或函数来比较按钮上设置的文本。所有这些都在QT C++中。
发布于 2022-04-20 07:26:56
那将是QAbstractPushButton::text()。
QAbstractPushButton::text()
例如:
QPushButton button{"Hello"}; assert(button.text() == "Hello");
https://stackoverflow.com/questions/71934755
相似问题