[Interest] make QCompleter behave like terminal compleetion

Frank Rueter | OHUfx frank at ohufx.com
Thu Oct 19 07:04:45 CEST 2017


Hi all,

I am trying to make a QLineEdit behave like a terminal in terms of auto  
completing file paths when hitting the tab key.
I found this article 
<https://stackoverflow.com/questions/9044001/qcompleter-and-tab-key> but 
it only gets me half way there. The tab key does work with this 
(slightly modified) code but it only selects the next matching word, 
when I need it to complete a match if possible and enter the next level.
Best to explain using an example I guess:
There is a file path like this:

/level1/level2/level3

Then I type "/le" and hit tab it auto-completes to "/level1", but it 
does not add the trailing slash requiring me to hit enter first, then 
start typing again.

If there are no other matches I need the tab key to auto-complete and 
enter the next directory.
Could somebody help me out please?

Cheers,
frank


-- 
ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
and consulting <http://ohufx.com/index.php/vfx-customising>* *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171019/be8ecc4d/attachment.html>


More information about the Interest mailing list