Fix loading of QtkWidget in mainwindow
This commit is contained in:
		
							parent
							
								
									a04ebae42a
								
							
						
					
					
						commit
						c948d9e1a6
					
				@ -17,9 +17,8 @@ MainWindow::MainWindow(QWidget * parent) :
 | 
				
			|||||||
  ui->setupUi(this);
 | 
					  ui->setupUi(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Find all QtkWidgets in this QMainWindow and initialize their scenes.
 | 
					  // Find all QtkWidgets in this QMainWindow and initialize their scenes.
 | 
				
			||||||
  for(const auto widget : ui->qWidget->children()) {
 | 
					  auto children = ui->centralwidget->findChildren<Qtk::QtkWidget *>();
 | 
				
			||||||
    auto qtkWidget = dynamic_cast<Qtk::QtkWidget *>(widget);
 | 
					  for(const auto qtkWidget : children) {
 | 
				
			||||||
    if(qtkWidget != nullptr) {
 | 
					 | 
				
			||||||
    std::string key = qtkWidget->objectName().toStdString();
 | 
					    std::string key = qtkWidget->objectName().toStdString();
 | 
				
			||||||
    // Initialize each scene into a map if it doesn't exist.
 | 
					    // Initialize each scene into a map if it doesn't exist.
 | 
				
			||||||
    if(mScenes[key] == nullptr) {
 | 
					    if(mScenes[key] == nullptr) {
 | 
				
			||||||
@ -28,7 +27,7 @@ MainWindow::MainWindow(QWidget * parent) :
 | 
				
			|||||||
    // Set the QtkWidget to use the scene associated with this widget.
 | 
					    // Set the QtkWidget to use the scene associated with this widget.
 | 
				
			||||||
    qtkWidget->setScene(mScenes[key]);
 | 
					    qtkWidget->setScene(mScenes[key]);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  }
 | 
					  // TODO: Use QPlainTextEdit or similar for debug console
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Set the window icon used for Qtk.
 | 
					  // Set the window icon used for Qtk.
 | 
				
			||||||
  // TODO: Update this to be something other than kilroy.
 | 
					  // TODO: Update this to be something other than kilroy.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user