private:bool wasSelected;public:signals: void selected(); void unselected();
wasSelected = false;
if( isSelected() ){ if( ! wasSelected ) { emit selected(); wasSelected = true; }}else{ if( wasSelected ) { emit unselected(); wasselected = false; }}