Hello all and thank you for allowing me the pleasure of asking my noob questions! I am learning by myself so it is nice to know there is a community of people working together! Here is my question.

Qt Code:
  1. void Edge::on_slotSizeW_textChanged(const QString &arg1)
  2. {
  3. QSettings settings("slots.ini",QSettings::IniFormat);
  4. QString profileName;
  5. QString slotName;
  6.  
  7. QString objName = ui->slotSizeW->objectName();
  8. QString objValue = ui->slotSizeW->text();
  9.  
  10.  
  11. QList<QListWidgetItem*> items = ui->profileSettingsList->selectedItems();
  12. foreach(QListWidgetItem* item, items)
  13. {
  14. profileName.append(item->text());
  15.  
  16. QList<QListWidgetItem*> items = ui->slotList->selectedItems();
  17. foreach(QListWidgetItem* item, items)
  18. {
  19. slotName.append(item->text());
  20.  
  21. settings.beginGroup(profileName);
  22. settings.beginGroup(slotName);
  23. settings.setValue(objName,objValue);
  24. settings.endGroup();
  25.  
  26. qDebug() << objName;
  27. }
  28. }
  29. }
To copy to clipboard, switch view to plain text mode 

in this example is there a way to automatically reference the widget here:

Qt Code:
  1. QString objName = ui->slotSizeW->objectName();
  2. QString objValue = ui->slotSizeW->text();
To copy to clipboard, switch view to plain text mode 

I want to be able to remove ui->slotSizeW and automatically return whichever widget is in focus. Possible? Thank you again