QString str = QString().fill('x', 10); // The value of str will be "xxxxxxxxxx"
QString str = QString().fill("abc", 5); // The value of str will be "abcab"
QString str = QString().fill("01", 12); // The value of str will be "010101010101"The QString fill method is part of the Qt Core library. Therefore, to use this method, you need to include the header file "QString" and link against the "Qt5Core" library.