| 131 | } |
| 132 | |
| 133 | void CAddressCompleter::attachToLineEdit(QLineEdit *lineEdit) |
| 134 | { |
| 135 | if (m_pLineEdit) { |
| 136 | m_pLineEdit->removeEventFilter(this); |
| 137 | m_pLineEdit->setToolTip(m_szOldLineEditToolTip); |
| 138 | } |
| 139 | |
| 140 | m_pLineEdit = lineEdit; |
| 141 | if (m_pLineEdit) { |
| 142 | m_szOldLineEditToolTip = m_pLineEdit->toolTip(); |
| 143 | m_pLineEdit->setToolTip(m_szLineEditToolTip); |
| 144 | m_pLineEdit->installEventFilter(this); |
| 145 | connect(m_pLineEdit, &QLineEdit::textEdited, |
| 146 | this, &CAddressCompleter::onTextChanged); |
| 147 | |
| 148 | // 设置提示文本 |
| 149 | m_pLineEdit->setPlaceholderText(m_szEnter); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | void CAddressCompleter::setMaxVisibleItems(int count) |
| 154 | { |
no outgoing calls
no test coverage detected