qtgui: fixes some bugs between qwt 5 and 6, some reorg.