Hello,

I am using the QT GUI editor to create a small aplication that displays my SQLITE data. I created a class called IdentitySQL that reads the data and returns a QTableView*. When I use the GUI editor, I dragged a tableview object into my main window and gave it the name identityTableView. I'm trying to set that tableview to the one I generated in my class.

Qt Code:
  1. ImsiViewerGui::ImsiViewerGui(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::ImsiViewerGui)
  4. {
  5. ui->setupUi(this);
  6. setTable();
  7. }
  8.  
  9. ImsiViewerGui::~ImsiViewerGui()
  10. {
  11. delete ui;
  12. }
  13.  
  14. void ImsiViewerGui::changeEvent(QEvent *e)
  15. {
  16. QMainWindow::changeEvent(e);
  17. switch (e->type()) {
  18. case QEvent::LanguageChange:
  19. ui->retranslateUi(this);
  20. break;
  21. default:
  22. break;
  23. }
  24. }
  25.  
  26. void ImsiViewerGui::setTable()
  27. {
  28. IdentitySQL *isql = new IdentitySQL(this);
  29.  
  30. isql->connect("c:\\temp\\Identity.db");
  31. ui->identityTableView = isql->createTableView( "IMSI Grabber ");
  32. }
To copy to clipboard, switch view to plain text mode 

In the above code, I set the ui object equal to the other table view but it will never show it when I start the application. The only way I can get this to work is if I edit the ui_<project name>.h file. Unfortunately, every time I made changes to the ui it regenerates the ui_ file and deletes my changes.

What is the best way to accomplish what I am trying to do? Is there a simple refresh command that I need to run or is there a better method?

Thanks in advance!

Emorgen