Hi everyone!

I am attemptting to access to elements of mainwindow.ui (it would be named ui elements? ).

I have two sample of use of this elements.

First work fine but in case of comboBox It doen't work.

Could you help me?

Qt Code:
  1. QString def_fileGbxml = ui->lineEditFile->text();
  2.  
  3. QComboBox cb_tipoEdificio = this->ui->comboBox_1
To copy to clipboard, switch view to plain text mode 

How can define it to use in my mainwindow.cpp. I want to load it from file of data.

I have data on file like that:

Qt Code:
  1. constructionIdRefs:
  2. cons-1
  3. cons-2
  4. cons-3
  5. cons-4
  6. cons-5
  7. cons-6
  8. ***************
  9. openingTypes:
  10. FixedWindow
  11. NonSlidingDoor
  12. end1;
  13. end2;
To copy to clipboard, switch view to plain text mode 

I can write file like I want. Do you recommend another organization of data??

On the other hand. I read about define manual ComboBox and Label but in this way I can't view it in main window.

For example:

Qt Code:
  1. QGridLayout *layoutPrincipal = new QGridLayout();
  2. layoutPrincipal->addWidget(new QLabel("Latitud"),0,0);
  3. latitud = new QLineEdit();
  4. layoutPrincipal->addWidget(latitud,0,1);
  5. layoutPrincipal->addWidget(new QLabel("Longitud"),1,0);
  6. longitud = new QLineEdit();
  7. layoutPrincipal->addWidget(longitud,1,1);
  8.  
  9. getLocation = new QPushButton("Get Position");
  10. layoutPrincipal->addWidget(getLocation,3,0,1,2);
  11.  
  12. valores_combo << "primero" << "segundo" << "tercero";
  13. combo_buildings = new QComboBox();
  14.  
  15. combo_buildings->addItems(valores_combo);
  16.  
  17. this->setWindowTitle("Config of initial values of gbxml");
  18. this->setLayout(layoutPrincipal);
To copy to clipboard, switch view to plain text mode 

Is there any way to view this elements in mainwindow.ui?

It is possible a mix of both?