这可能是因为您的QToolButton没有设置文本,只设置了ToolTip。请尝试在使用setToolTip方法之前,使用setText方法来设置按钮上的文本。
例如:
QToolButton *button = new QToolButton(parent);
button->setText("My Button");
button->setToolTip("This is my button");
这样就会在按钮上显示”My Button”文本,并且当鼠标悬停在按钮上时,将显示提示”This is my button”。