Set completion inline due to a bug in Qt for popup mode

This commit is contained in:
Grégory Soutadé 2012-03-11 09:04:29 +01:00
parent 8daedb25ab
commit d0d0304ce4
5 changed files with 10 additions and 8 deletions

2
README
View File

@ -2,7 +2,7 @@ KissCount is personnal account software delivered under GPL v3 licence terms.
Current version is 0.3
Qt4 (>= 4.7), libqt4-sql-sqlite and libofx are needed
Qt4 (>= 4.7), libqt4-sql-sqlite and libofx (Linux only) are needed
If you use web view, edit database.php and set $BDD_FILE, it's higly recommanded to use an SSL certificate.

View File

@ -2,7 +2,7 @@ KissCount est un logiciel de gestion de comptes personnels délivré sous licenc
La version actuelle est 0.3
Qt4 (>= 4.7), libqt4-sql-sqlite et libofx sont nécessaires
Qt4 (>= 4.7), libqt4-sql-sqlite et libofx (Uniquement pour Linux) sont nécessaires
Si vous utilisez la version web pour visualiser vos comptes, éditez d'abord le fichier database.php en positionnant correctement la variable $BDD_FILE, il est fortement recommandé d'utiliser un certificat SSL.

View File

@ -225,6 +225,7 @@ void GridAccount::LoadOperations(std::vector<Operation>* operations, int month,
_kiss->GetHistory(month, year, list);
_completer = new QCompleter(list);
_completer->setCaseSensitivity(Qt::CaseInsensitive);
_completer->setCompletionMode(QCompleter::InlineCompletion);
}
TabDelegate* descriptionEditor = new TabDelegate(this, &_displayedOperations, _completer);
@ -431,6 +432,8 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
}
else
{
item = new QTableWidgetItem("");
setItem(line, DESCRIPTION, item);
if (fix)
{
SET_ROW_COLOR(line, view::OWN_YELLOW, Qt::black);

View File

@ -85,7 +85,6 @@ private:
QSignalMapper _treeSignalMapper, _checkSignalMapper, _deleteSignalMapper;
bool _inModification;
QCompleter* _completer;
void SetWeek(int week, int line);
void ResetWeeks();
void ComputeWeeks();

View File

@ -38,7 +38,7 @@ void TabDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
QLineEdit *line = qobject_cast<QLineEdit *>(editor);
QString value = line->text().trimmed();
if (index.row() < _operations->size() && (*_operations)[index.row()].id &&
if (index.row() < (int) _operations->size() && (*_operations)[index.row()].id &&
(*_operations)[index.row()].parent)
model->setData(index, qVariantFromValue(" " + value));
else