Results 1 to 6 of 6

Thread: keyPressEvent and auto completion

  1. #1
    Join Date
    Jun 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default keyPressEvent and auto completion

    Hello,

    I'm trying to do an auto completer for parenthesis but when I insert ")" in my QPlainText while "(" key is pressed I get ")(" instead of "()". That 's propably because the inserted text is written before the pressed key. How could I do?
    Tanks for your help.

    PS: I don't want to use keyReleaseEvent because this is lagging to much.

  2. #2
    Join Date
    Jun 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: keyPressEvent and auto completion

    Any idea of what the setKeepPositionOnInsert should do?

  3. #3
    Join Date
    Jun 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: keyPressEvent and auto completion

    I thought of using scintilla in my qplaintextedit but I wonder if it's possible? I saw the qsciscintillabase doc and it says that low level API are implemented on it.

  4. #4
    Join Date
    Jun 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: keyPressEvent and auto completion

    In fact I don't have any idea how to implement indentation without qscintilla.

  5. #5
    Join Date
    Jun 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: keyPressEvent and auto completion

    Could you simply give your idea?

  6. #6
    Join Date
    Jun 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: keyPressEvent and auto completion

    I finally achieved to code my "indentor". If someone is interested in it just send me a PM

Similar Threads

  1. Replies: 2
    Last Post: 16th November 2010, 07:11
  2. Qt Creator auto completion problem
    By chew in forum Newbie
    Replies: 1
    Last Post: 23rd July 2010, 11:33
  3. keyPressEvent - auto-repeat immediately
    By Macok in forum Qt Programming
    Replies: 1
    Last Post: 16th March 2009, 06:31
  4. Multiple completion
    By gruszczy in forum Qt Programming
    Replies: 1
    Last Post: 3rd March 2009, 23:40
  5. [COMPLETION] I am looking for a simple way to ...
    By babali in forum Qt Programming
    Replies: 3
    Last Post: 21st January 2008, 12:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.