modified to Qt from Tk