You should write:
vectorA = QVector::fromList(listA);
as fromList
is a static method of the class QVector
.
The code you wrote create a QVector
from listA
but as you do not store it in some variable using the assignment operator or use it through a function call for instance, the QVector is dropped. Either way, vectorA remains empty.
Alternatively, you can use QList::toVector
the following way:
vectorA = listA.toVector();