Something like that?

list << query.exec("select kod_lekarstwa, nazwa from lekarstwo;");