[QScintilla] Question about setTest

David Moreno saimazoon at terra.es
Sat Mar 26 07:19:25 GMT 2011


  Hi

   I've tried the replace method but I think it only works for selected
  words after a find. Neverless I make it work, but I'm not completely
  sure this the proper way to do it:


    linea = texto->text(i); // Extrae la línea...
    length = linea.size();
    linea.remove(linea.indexOf('!'),1);
    texto->setSelection(i,0,i,length-1);
    texto->removeSelectedText();
    texto->insertAt(linea,i,0);

  Regards
> 
> Mikhail Murzin escribió:
>> You can select the whole line (you have the coordinates of the 
>> beginning and you can get line length) and replace selection with your 
>> text.
>> -- 
>> Best regards,
>> Mikhail.
>>
>>
>> On Fri, Mar 25, 2011 at 2:53 PM, David Moreno <saimazoon at terra.es 
>> <mailto:saimazoon at terra.es>> wrote:
>>
>>     Hi All
>>
>>      May be this is a very obvious question but we have a function to
>>     retrive the text contained in a line (->text(line)), but There is a
>>     functon to set the text of a line?. InsertAt will append, and
>>     setText looks like it will set the whole text, there is a sort of
>>     setText(string, line) ?
>>
>>     Thanks
>>     _______________________________________________
>>     QScintilla mailing list
>>     QScintilla at riverbankcomputing.com
>>     <mailto:QScintilla at riverbankcomputing.com>
>>     http://www.riverbankcomputing.com/mailman/listinfo/qscintilla
>>
>>
> 
> 



More information about the QScintilla mailing list