Hi and welcome to devnet,
QAbstractScrollArea might be a starting point if you want to go from scratch.
QTextEdit could also be an inspiration.
Take into account that "infinite" means also extensive use of memory so you should have something that unloads useless stuff when not shown as otherwise it's going to eat your system's resources.