Clean some code and add connection create connection when window is selected
replace slots by Q_SLOTS