QT QLineEdit光标问题

继承QLineedit类,重写Fousinevent和Focusoutevent判断在哪个文本框编辑,可是两个文本框都有光标在闪图片说明
类中的两个事件代码是:
void SpecialLineEdit::focusInEvent(QFocusEvent *){
this->setEnabled(true);
this->setFocus();
if(this->text()==InitialText){ this->clear(); }
}
void SpecialLineEdit::focusOutEvent(QFocusEvent *){
if(this->text()==NULL){ this->setText(InitialText); }
this->clearFocus();
}

查看全部
yaojingdedaogao
yaojingdedaogao
2015/08/26 12:17
  • qt
  • 点赞
  • 收藏
  • 回答
    私信

1个回复