Qt revert + minimal changes

Revert last merge
Minimal changes so that new Qt UI works.