Bekomm ich dort nicht den ascii wert? wie bekomm ich dann den ascii-wert?const char QChar::toAscii () const
Returns the character value of the QChar obtained using the current codec used to read C strings, or 0 if the character is not representable using this codec. The default codec handles Latin-1 encoded text, but this can be changed to assist developers writing source code using other encodings.
The main purpose of this function is to preserve ASCII characters used in C strings. This is mainly useful for developers of non-internationalized software.
QTextEdit bzw. QString in ASCII7
-
Burgpflanze
- Beiträge: 89
- Registriert: 24. Februar 2006 16:41
- Wohnort: Dresden
Du kannst es ja auch mit einer while-Schleife machen:
Code: Alles auswählen
QString text = ui.textEdit.toPlainText();
int counter = text.length() -1;
while( counter > -1 )
{
if( text.at( counter ).toAscii() > 127 )
text.remove( counter, 1 );
else
counter--;
}
Gruß, Peter
-
NoobSaibot
- Beiträge: 99
- Registriert: 27. Januar 2005 15:55
danke. ich habs jetzt hinbekommen.
Code: Alles auswählen
f( text.at(i).unicode()>127 ) { ...