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. Custom completer does not show if there is no space before word
Forum Updated to NodeBB v4.3 + New Features

Custom completer does not show if there is no space before word

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 432 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.
  • SikarjanS Offline
    SikarjanS Offline
    Sikarjan
    wrote on last edited by Sikarjan
    #1

    Hi,

    I combined the custom completer example with the text editor example but the completer does not show up when there is no space before the "text under curser". If the completer contains "form" it will not show up when I type

    for| 
    

    but it will when I have a a space before:

     for|
    

    In both cases the text under curser function returns "for". When I put a qDebug() << "test" at the end of the keyPressed function, right behind pop it up it will show. So the entire function is executed but no popup window with the suggestions. I do not know how I should debug this. I just copy and pasted the sample code again into my code to make sure the keyPressed function is identical.

    Thanks for any suggestions

    [Update]
    I added the following code below the comment pop it up

        if(!c->popup()->isVisible())
            c->popup()->setVisible(true);
        qDebug() << c->popup()->isVisible() << cr.x() << cr.y();
    

    The output is "true 89 92"
    But the actual popup window is a white square in the left upper corner of my screen (outside of the app window). Does this give a hint of what is going on?

    1 Reply Last reply
    0
    • SikarjanS Offline
      SikarjanS Offline
      Sikarjan
      wrote on last edited by
      #2

      Found the bug. The text under curser function returned the line break as well. When I printed out the value in the function it did not show but it did when I printed out the prefix value (the returned value) in the keyPressed function. After adding a trimmed() to the return value the code works again as expected.

      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