comparison src/findwidget.cpp @ 557:57a7f95ef400 find

Make find widget behave as if text is cleared when it's closed, and restored when it's opened again
author Chris Cannam
date Thu, 23 Feb 2012 15:28:29 +0000
parents 04f18b2a32e8
children d932ce55c364
comparison
equal deleted inserted replaced
556:04f18b2a32e8 557:57a7f95ef400
59 QAbstractButton *button = qobject_cast<QAbstractButton *>(sender()); 59 QAbstractButton *button = qobject_cast<QAbstractButton *>(sender());
60 if (!button) return; 60 if (!button) return;
61 if (m_lineEdit->isVisible()) { 61 if (m_lineEdit->isVisible()) {
62 m_lineEdit->hide(); 62 m_lineEdit->hide();
63 button->setText(tr("Find...")); 63 button->setText(tr("Find..."));
64 if (m_lineEdit->text() != "") {
65 emit findTextChanged("");
66 }
64 } else { 67 } else {
65 m_lineEdit->show(); 68 m_lineEdit->show();
66 button->setText(tr("Find:")); 69 button->setText(tr("Find:"));
70 if (m_lineEdit->text() != "") {
71 emit findTextChanged(m_lineEdit->text());
72 }
67 } 73 }
68 } 74 }
69 75