I have the following code to change the background of a line edit when it is edited by the user:

Qt Code:
  1. ProgramMain::ProgramMain() {
  2. connect( ui.vendorname, SIGNAL( textEdited() ), this, SLOT( colorbackground() ) );
  3. }
  4.  
  5.  
  6. ProgramMain::colorbackground() {
  7. ui.vendorname->setStyleSheet( QString( "background-color: yellow"));
  8. }
To copy to clipboard, switch view to plain text mode 

This works, however I have many line edits in the UI file and I would like to have them all change color if the user edits them.

is there any way I can make a single slot that can handle any line edit? Or will I need to make a slot for each line edit that I want to change the color for?