move code out of qt_display#initialize