Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems suppressing keystrokes when connecting QCompleter to Q
Forum Updated to NodeBB v4.3 + New Features

Problems suppressing keystrokes when connecting QCompleter to Q

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    edreamleo
    wrote on last edited by
    #1

    Hello all,

    I am attempting to use QCompleter connected to a (subclass of) QTextBrowser. Everything works as expected, except that I have had no joy suppressing entering of keystrokes into the QTextBrowser when the QCompleter is active. This is a show stopper.

    My apps standard event filter properly catches the key events (event.type is event.ShortcutOverride). Alas, setting event.accept() does not cause they keys to be ignored later: the keys appear in the QTextBrowser. In contrast, setting event.ignore() (for the up and down arrow keys) does cause the QCompleter to recognize those keys and treat them as usual.

    Similarly, having the event filter return True does not cause the QTextBrowser to ignore the keys. This looks like a bug in the interaction of QCompleter and QTextBrowser.

    Can anyone suggest a way forward? Thanks.

    Edward

    P.S. The Python init code I use is:

    cpl = self.completer = QCompleter()
    cpl.setWidget(self.body) # self.body is a subclass of QTextBrowser
    cpl.connect(cpl,QtCore.SIGNAL("activated(QString)"),completion_callback)
    

    EKR

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved