【发布时间】:2013-05-07 08:06:30
【问题描述】:
当鼠标悬停在按钮上时,我需要显示“帮助文本”,我用谷歌搜索并尝试了一些代码,但没有成功。
谁能纠正我?
if (event->type() == QEvent::Enter)
{
if (obj == q1)
{
iarm->printStatus("hi"); // For debugging
QAction *newAct = new QAction(tr("&New"), this);
newAct->setShortcut(tr("Ctrl+N"));
newAct->setStatusTip(tr("Create a new file"));
newAct->setWhatsThis(tr("Click this option to create a new file."));
}
}
【问题讨论】:
-
tooltip 怎么样?
-
工具没有给我智能文本,但它可能是解决方案
-
“智能文本”是什么意思?
标签: c++ qt qpushbutton