Results 1 to 2 of 2

Thread: Move QCompleter on QRect x,y

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Move QCompleter on QRect x,y

    i find QsciScintilla a super libs but code AutoCompletion not run ok... it display a not clickable widged.... ( only keyboard can secect!)

    i have implement the QT4 QCompleter combobox and its run Super..

    only its display on not correct place ....
    my problem how i can find the cursor QRect on QsciScintilla?



    i bring QsciScintilla getWord(int position) to public and i can bring word to QCompleter class...


    Qt Code:
    1. /* completer from qt4 make it */
    2. void QViScintilla::CursorAtIndex(int line ,int cool )
    3. {
    4. /* start from connect(this, SIGNAL(cursorPositionChanged(int,int)),this, SLOT(CursorAtIndex(int,int))); */
    5. setAutoCompletionFillupsEnabled(false); /* ensure not start scite autoxx */
    6. int newPos = SendScintilla(SCI_GETCURRENTPOS);
    7. CURRENTWORD = getWord(newPos); /* bring getWord(int position) to public !!!!! */
    8. qDebug() << "### word " << CURRENTWORD; /* word piece on cursor */
    9. }
    10.  
    11. /* now i display it so ... its not correct cursor position ..... display qt4 QCompleter */
    12. QPoint pointers(QCursor::pos());
    13. QRect cr = QRect ( posX, posY ,20,20);
    14. cr.setWidth(c->popup()->sizeHintForColumn(0) + c->popup()->verticalScrollBar()->sizeHint().width());
    15. c->complete(cr); // popup it up!
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

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.