<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body link="#0000EE" text="#000000" vlink="#551A8B" alink="#EE0000"
    bgcolor="#ffffff">
    <div class="moz-cite-prefix">Am 5/17/2013 11:45 PM, schrieb Thomas
      Meyer:<br>
    </div>
    <blockquote cite="mid:519723A5.5000603@meyer-thomas.com" type="cite">
      <pre wrap="">Hi,
how can I send a simple string (QString) from a plugin to the 'General 
Messages' panel (or pane)
and how to the TextEditor (an opened text file)?</pre>
    </blockquote>
    <br>
    Hi,<br>
    <br>
    you can use EditorManager<span style=" color:#800080;"></span><span
      style=" color:#000000;">::</span><span style=" color:#000000;">currentEditor</span><span
      style=" color:#000000;">() to get the editor</span>.<br>
    You receive an IEditor object, which you have to cast to
    ITextEditor.<br>
    ITextEditor define the function insert(const QString& string)<span
      style=" color:#800080;"><font color="#000000">....</font><br>
    </span><span style=" color:#800080;"><br>
      <font color="#000000">sample code:</font><br>
    </span><br>
    <span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">if</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span
      style=" color:#800080;">IEditor</span><span style="
      color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span
      style=" color:#000000;">editor</span><span style=" color:#c0c0c0;">
    </span><span style=" color:#000000;">=</span><span style="
      color:#c0c0c0;"> </span><span style=" color:#800080;">EditorManager</span><span
      style=" color:#000000;">::</span><span style=" color:#000000;">currentEditor</span><span
      style=" color:#000000;">())</span><span style=" color:#c0c0c0;"> </span><span
      style=" color:#000000;">{</span>
    <br>
    <span style=" color:#c0c0c0;"></span><span style=" color:#808000;">   
      if</span><span style=" color:#c0c0c0;"> </span><span style="
      color:#000000;">(</span><span style=" color:#800080;">TextEditor</span><span
      style=" color:#000000;">::</span><span style=" color:#800080;">ITextEditor</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span
      style=" color:#000000;">textEditor</span><span style="
      color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#000000;">qobject_cast</span><span
      style=" color:#000000;"><</span>TextEditor<span style="
      color:#000000;">::</span>ITextEditor<span style=" color:#c0c0c0;">
    </span><span style=" color:#000000;">*>(</span><span style="
      color:#000000;">editor</span><span style=" color:#000000;">))</span><br>
            <span style=" color:#c0c0c0;"></span><span style="
      color:#000000;">textEditor</span><span style=" color:#000000;">-></span><span
      style=" font-style:italic; color:#000000;">insert</span><span
      style=" color:#000000;">(</span><span style=" color:#800080;">QString</span><span
      style=" color:#000000;">(</span><span style=" color:#008000;">"Hello</span><span
      style=" color:#c0c0c0;"> </span><span style=" color:#008000;">world"</span><span
      style=" color:#000000;">));</span><br>
    <span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">}</span><br>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    Don't forget to add the TextEditor Plugin as a dependencie to your
    plugin :)<br>
    <br>
    BR,<br>
    David<br>
    <br>
    <blockquote cite="mid:519723A5.5000603@meyer-thomas.com" type="cite">
      <pre wrap="">
Where can I find some documentation about the 'communication' (sending 
or receiving strings etc.)
between plugins and the different panes (panels?) and the TextEditor?

Example:
I have build a simple plugin, which is a dialog with a button 'send 
text' and should send
'Hello world' to an opened text file. For 'debugging' I want to send 
'send text pressed'
to the 'General Messages' pane.

Thanks,
     Thomas


_______________________________________________
Qt-creator mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qt-creator@qt-project.org">Qt-creator@qt-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/qt-creator">http://lists.qt-project.org/mailman/listinfo/qt-creator</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>