void SearchModel::searchResult(QStringList result) { unsigned size = (unsigned)Match_.size(); Match_ = GetContactListModel()->getSearchedContacts(result.toStdList()); emit dataChanged(index(0), index(size)); if (!result.isEmpty()) emit results(); }
/** ***************************************************************************/ InputLine::InputLine(QWidget *parent) : QLineEdit(parent) { _settingsButton = new SettingsButton(this); _settingsButton->setObjectName("settingsButton"); _settingsButton->setFocusPolicy(Qt::NoFocus); _settingsButton->setShortcut(QKeySequence(SETTINGS_SHORTCUT)); _currentLine = _lines.crend(); // This means historymode is not active connect(this, &QLineEdit::textEdited, this, &InputLine::resetIterator); // DESERIALIZATION QFile dataFile(QDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation)). filePath(QString("history.dat"))); if (dataFile.exists()){ if (dataFile.open(QIODevice::ReadOnly| QIODevice::Text)) { QDataStream in(&dataFile); QStringList SL; in >> SL; _lines = SL.toStdList(); dataFile.close(); } else qWarning() << "Could not open file" << dataFile.fileName();