Getting plain text from Plasma::TextEdit

Richard Dale richard.j.dale at gmail.com
Tue Jul 21 15:42:56 CEST 2009


On Tue, Jul 21, 2009 at 1:46 PM, HB<mszubart at gmail.com> wrote:
> Hello,
>
> Is there any way to get plain text from Plasma::TextEdit?
>
> Plasma::TextEdit is child of KTextEdit, which is child of QTextEdit (right?)
>
> So, Plasma::TextEdit should have method toPlainText()
>
> I'm writing in Ruby, but in comments I have placed C++ code (but not
> checked it)
>
> This is my code:
>
>
> box = Plasma::TextEdit.new(self)  # C++: Plasma::TextEdit box* = new
> Plasma::TextEdit::TextEdit(parent);
>
> # ... other operations
>
> # C++: QString tekst = box->toPlainText ();
>
> tekst = box.toPlainText # not working 'method_missing'
>
> # other try:
>
> tekst = box.to_plain_text # not working 'method_missing'
>
> # ... many other tries
>
>
> Please tell me. Did Plasma::TextEdit have method for getting plain text?
> (I would be pleased to get link to the documentation)
The easiest way to find out what is in the Ruby api is by using the
'rbqtapi' command line tool. For instance:

$ rbqtapi -rplasma_applet -s -p -mtext Plasma::TextEdit
String Plasma::TextEdit#text
Plasma::TextEdit#textChanged
Qt::GraphicsProxyWidget#contextMenuEvent(Qt::GraphicsSceneContextMenuEvent)
Qt::GraphicsItem#contextMenuEvent(Qt::GraphicsSceneContextMenuEvent)

Oops it has matched 'Context' as well, but I hope you get the idea.

The '-s' option means show the results in a 'ruby-like' format, the
'-p' option means look in the parent classes and the '-m' option takes
a regular expression to match.

To find out if there are any methods with 'plain' in their names you
could try ('-i' means a case insensitive match)::

$ rbqtapi -rplasma_applet -p -i -mplain Plasma::TextEdit

And it doesn't return anything..

-- Richrad


More information about the Plasma-devel mailing list