|
|
This is the kparts interface classes for text editors. The text editors use the Document/View model that allows multiple views into one file (Document)
Line numbers passed via this interface must begin at line number zero (0).
TODO: See documentation at http://??????? for information on how to use kparts in general. A simple (but sufficient) implementation is shown below.
QHBoxLayout *layout = new QHBoxLayout(this); QSplitter *fixme = new QSplitter(this); KTrader::OfferList offers = KTrader::self()->query( "KTextEditor/Document" ); assert( offers.count() >= 1 ); KService::Ptr service = *offers.begin(); KLibFactory *factory = KLibLoader::self()->factory( service->library() ); assert( factory ); m_part = static_cast<KTextEditor::Document *>( factory->create( this, 0, "KTextEditor::Document" ) ); assert( m_part ); m_part->createView( fixme, 0 ); layout->addWidget(fixme); m_part->setText( "" ); |
You may also be able to use a dynamic_cast for the document part above (depending on compliation of the library used)
The View class encapsulates a single view into the document.
Generated by: marc@yogi on Tue Mar 27 13:10:07 2001, using kdoc 2.0a48. |