This commit is contained in:
2025-03-08 12:08:35 -05:00
parent c86a7744b3
commit 16baf6cdaf
6 changed files with 44 additions and 28 deletions

View File

@@ -18,6 +18,14 @@ int main(int argc, char * argv[])
QApplication a(argc, argv);
auto window = MainWindow::getMainWindow();
// Qtk currently uses the decorator pattern to save / load scenes.
// This is a temporary solution and will be improved in the future.
// NOTE: We set the scene here and not in QtkMainWindow to detach the scene
// from the QtkWidget plugin (qtk_plugin_library build target).
// Once we can save / load scenes, this call, and QtkScene, can be removed.
window->getQtkWidget()->setScene(new QtkScene);
window->show();
return QApplication::exec();

View File

@@ -7,7 +7,6 @@
##############################################################################*/
#include "qtkmainwindow.h"
#include "qtkscene.h"
#include "ui_qtkmainwindow.h"
MainWindow * MainWindow::mainWindow_ = Q_NULLPTR;
@@ -28,9 +27,6 @@ MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent)
// Initialize static container for all active QtkWidgets
auto qtkWidgets = findChildren<Qtk::QtkWidget *>();
for (auto & qtkWidget : qtkWidgets) {
// Qtk currently uses the decorator pattern to save / load scenes.
// This is a temporary solution and will be improved in the future.
qtkWidget->setScene(new QtkScene);
views_.emplace(qtkWidget->getScene()->getSceneName(), qtkWidget);
// Add GUI 'view' toolbar option to show debug console.