summaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-07-14 19:09:37 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-14 15:22:00 -0700
commit536469107d94f265a03e44fcc755b92b9016cbca (patch)
tree1ff37a3fc654724fc917e71e5134329f256f03ea /qt-ui/locationinformation.h
parentcd3f10d5ad4124960b66112074797a16517117e9 (diff)
downloadsubsurface-536469107d94f265a03e44fcc755b92b9016cbca.tar.gz
Fix selecting the first index
The way a QCompleter works is that it grabs whatever data it has in the completerRole and sets it back on the line edit. I Bypassed the QCompleter delegate to show something other than the completerRole (so, for instance, if you write 'B', you could get 'Blue Hole' as the returned text, but in fact the QCompleter has the 'B' as internal string (because of the weird - and wrong way in which we are dealing with completion - trying to complete for something that's not inside the model yet). So I hooked up a signal that will listen to the complete's index, and if it's the first row() it's surely the special case - then we bypass QCompleter return string and use our own. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.h')
-rw-r--r--qt-ui/locationinformation.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h
index b37731969..b55a1b42c 100644
--- a/qt-ui/locationinformation.h
+++ b/qt-ui/locationinformation.h
@@ -51,6 +51,8 @@ public:
void handleActivation(const QModelIndex& activated);
void resetDiveSiteUuid();
uint32_t diveSiteUuid() const;
+signals:
+ void setLineEditText(const QString& text);
private:
uint32_t last_uuid;