proposal for extension of KTextEditor interface

Roberto Raggi raggi at cli.di.unipi.it
Sun Jan 5 01:52:04 UTC 2003


On Sunday 05 January 2003 01:39, F at lk Brettschneider wrote:
> Roberto Raggi wrote:
> >On Sunday 05 January 2003 01:03, F at lk Brettschneider wrote:
> >>Hi!
> >>FYI: Attached is the cool chat we had on 5/1/2003 about 1:00 MET. About
> >>the problem with showing debugger variable value tooltips via the
> >>texteditor interface...
> >>Cheers
> >>F at lk
> >
> >wow.. i like the idea to have this kind of tooltip ;) i suggest to add to
> >KTextEditor interfaces a method that describe how a "valid word" is made
> >
> >something like
> >  setWordValidator( const QValidator* wordValidator );
>
> Even cooler since it also reduces the number of signal emitting.
> Although I don't have a clue how the validator could detect valid stuff
> (variable names, expressions, ...) in native text. Do you already have
> an idea how to do it?

maybe with something like

// in cppsupport
class CppExpressionsValidator: public QValidator{
...
    virtual State validate ( QString & input, int & pos ) const {
         Context* ctx = computeContextFromCursorPosition( cursorPosition );
         if( ctx->containsVariable( input ) ) 
            return Acceptable;
         ....
    }
}

this works because validator is defined in kdevelop

ciao robe





More information about the KDevelop-devel mailing list