QString str = "Hello world!"; QStringRef subStr = str.midRef(5, 10); // subStr now contains "world!" as a reference to the original string.
QString str = "The quick brown fox jumps over the lazy dog"; QStringRef subStr = str.midRef(0, 8); // subStr now contains "The quick" as a reference to the original string.
QString str = "The quick brown fox jumps over the lazy dog"; QStringRef subStr = str.midRef(16, 5); // subStr now contains "fox j" as a reference to the original string.The midRef() method is a part of the Qt Core module, which is a part of the Qt library.