[QScintilla] Discovery the correct TextCursor QRect / Coordinate

Hans-Peter Jansen hpj at urpla.net
Tue Aug 7 17:42:22 BST 2007


Am Dienstag, 7. August 2007 18:28 schrieb Phil Thompson:
> On Tuesday 07 August 2007 10:43 am, PPK-Webprogramm wrote:
> > Hi all on list,
> >
> > i have implement on QsciScintilla  the QT4 QCompleter [
> > http://doc.trolltech.com/4.2/qcompleter.html ] combobox and its run
> > Super.. i grab data from a sqlite3 database file ...  + user words.
> >
> > I can grab and save word on
> > http://www.qt-apps.org/content/show.php/QKeyWord+grep+Robot+-+Word-Comp
> >lete r?content=59422
> >
> > Now my problem i can not find the correct QRect from TextCursor,  how i
> > find it?
> >
> > to start or not the QCompleter i use :
> >
> > class QSCINTILLA_EXPORT QsciScintilla : public QsciScintillaBase
> > {
> >     Q_OBJECT
> >
> > public:
> > .......
> > inline QString TextUnderCursor() {
> >     return getWord(SendScintilla(SCI_GETCURRENTPOS));
> >     }
> > ........
> >
> > How to make the same to have it QRect
> > http://doc.trolltech.com/4.3/qrect.html  ?
> >
> > http://www.qtcentre.org/forum/f-qt-programming-2/t-move-qcompleter-on-q
> >rect -xy-8421.html screenshoot:
> > http://www.qtcentre.org/forum/attachment.php?attachmentid=1456&d=118639
> >7139
>
> Are the SCI_POINTXFROMPOSITION and SCI_POINYFROMPOSITION messages what
> you want? See...
>
> http://scintilla.sourceforge.net/ScintillaDoc.html#SCI_POINTXFROMPOSITION
>
> If so I don't mind adding a convenience method that returns a QPoint for
> the current cursor position - or whatever you need.

Phil, could this approach solve the nasty "go away, when clicking somewhere 
else (without pressing Esc)" QScintilla problem, or is it already solved 
(differently)?

Pete


More information about the QScintilla mailing list