On Apr 20, 2011, at 9:02 AM, ext [email protected] wrote: > > On Apr 19, 2011, at 6:56 PM, ext David Villalobos Cambronero wrote: > >> Hi all, >> >> I have a editor, it opens files, make highlighting and all this kind of >> staff, but I can't figure out how to implement the Go To Line function, I >> have look at the qt-creator code but seems this functions is so complex to >> me ;), so, does anyone knows how qt-creator implements the go to line >> function? > > As of now your editor needs to be a ITextEditor subclass and implement the > gotoLine(int line, int column = 0) method.
Actually I see that this will only make the locator filter itself work. If your editor is not deriving from the BaseTextEditor and doesn't use the TextEditorActionHandler class, the menu item will still be disabled. To enable the action in the menu you'll need to register an action for id Core::Constants::GOTO yourself and implement opening the locator filter. Similar to TextEditorActionHandler::gotoAction() Not sure that this design is great... in any case, if you can possibly use BaseTextEditor[Widget] and TextEditorActionHandler for you text editor, you should do it, since it does provide you with (as the name says) already a base text editor implementation. -- Eike Ziller Software Engineer Nokia, Qt Development Frameworks Nokia gate5 GmbH Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B Umsatzsteueridentifikationsnummer: DE 812 845 193 Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori _______________________________________________ Qt-creator mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-creator
