首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

QToolTip 的运用

2012-09-20 
QToolTip 的使用高级用法,使用类型的 QEvent::ToolTip 的 QHelpEvent 事件(注意ignore使用)bool SortingBo

QToolTip 的使用
高级用法,使用类型的 QEvent::ToolTip 的 QHelpEvent 事件(注意ignore使用)

bool SortingBox::event(QEvent *event) {     if (event->type() == QEvent::ToolTip) {         QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);         if (xxxxxx) {             QToolTip::showText(helpEvent->globalPos(), "xxxxxxxxx");         } else {             QToolTip::hideText();             event->ignore();         }         return true;     }?return QWidget::event(event); }
立即显示 tooltip,就像上面用的,直接调用 showText()

来源:http://hi.baidu.com/cyclone/blog/item/825759824a9782ad0cf4d2f7.html

热点排行