This forum has been archived. All content is frozen. Please use KDE Discuss instead.

getobject by name from kotexteditor

Tags: None
(comma "," separated)
tmoti
Registered Member
Posts
7
Karma
0
OS

getobject by name from kotexteditor

Mon Aug 23, 2010 3:37 pm
guys,

I have this kotexteditor from a kwdocument and I was wondering how to retrieve an object ( like a QTextTable ) that's in the document. These objects have objectnames that I've set before with setObjectName.

moti
tmoti
Registered Member
Posts
7
Karma
0
OS
This is how I tried to solve it, comments are welcome:
Code: Select all
QTextTable* KWDocument::getTableByName( const QString& tableObjectName )
{
  KoTextDocument textDoc( mainFrameSet()->document());
  QTextDocument* doc = textDoc.document();
  Q_ASSERT( doc );

  return doc->findChild< QTextTable* >( tableObjectName );
}


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]