Logo Search packages:      
Sourcecode: qt-x11-free version File versions

QString & QString::insert ( uint  index,
const QString s 

Inserts s into the string at position index.

If index is beyond the end of the string, the string is extended with spaces to length index and s is then appended and returns a reference to the string.

      QString string( "I like fish" );
      str = string.insert( 2, "don't " );
      // str == "I don't like fish"

See also:
remove(), replace()

Definition at line 3859 of file qstring.cpp.

References length(), and unicode().

Referenced by QDir::cleanDirPath(), Uic::createFormDecl(), Uic::createFormImpl(), QRegExp::escape(), insert(), QUriDrag::localFileToUri(), QTextEdit::optimText(), prepend(), replace(), and QUriDrag::uriToLocalFile().

    // the sub function takes care of &s == this case.
    return insert( index, s.unicode(), s.length() );

Generated by  Doxygen 1.6.0   Back to index