当选中文本时,使用槽函数取消选中即可... ...
connect(lineEditTmp,SIGNAL(selectionChanged()),this,SLOT(SlotLineEditDeselect()));
void WidgetAge::SlotLineEditDeselect()
{
qobject_cast<QLineEdit*>(sender())->deselect();
}
两行代码搞定:)
如果追求性能,这种方法并不是最优的哦...
connect(lineEditTmp,SIGNAL(selectionChanged()),this,SLOT(SlotLineEditDeselect()));
void WidgetAge::SlotLineEditDeselect()
{
qobject_cast<QLineEdit*>(sender())->deselect();
}
两行代码搞定:)
如果追求性能,这种方法并不是最优的哦...