Hi,

I am using QUiLoader. Following is my code:

Qt Code:
  1. QUiLoader loader;
  2. QFile file(filename);
  3.  
  4. QWidget *form = loader.load(&file, this); //"this" here refers to the mainwindow class
  5.  
  6. int i;
  7. QObjectList list;
  8.  
  9. list = form->children();
  10. for(i = 0; i < list.size(); i++)
  11. {
  12. QString name = list.at(i)->objectName();
  13. qDebug() <<"object"<< i <<" = "<< name;
  14. }
  15.  
  16. file.close();
To copy to clipboard, switch view to plain text mode 

However the output only shows:

object 0 = "_layout"
object 1 = "qt_rubberband"
object 2 = ""
object 3 = "centralwidget"

There are two custom widgets on this form which are being loaded (their constructor called) but their object names are not being listed. Is there something I am missing.


-Charvi