Move MainWindow->Scene connection out of QtkWidget.
This commit is contained in:
parent
ecae09f82d
commit
0551b4f91f
@ -24,7 +24,7 @@ int main(int argc, char * argv[])
|
|||||||
// NOTE: We set the scene here and not in QtkMainWindow to detach the scene
|
// NOTE: We set the scene here and not in QtkMainWindow to detach the scene
|
||||||
// from the QtkWidget plugin (qtk_plugin_library build target).
|
// from the QtkWidget plugin (qtk_plugin_library build target).
|
||||||
// Once we can save / load scenes, this call, and QtkScene, can be removed.
|
// Once we can save / load scenes, this call, and QtkScene, can be removed.
|
||||||
window->getQtkWidget()->setScene(new QtkScene);
|
window->setScene(new QtkScene);
|
||||||
|
|
||||||
window->show();
|
window->show();
|
||||||
|
|
||||||
|
@ -102,3 +102,12 @@ void MainWindow::refreshScene(const QString & sceneName)
|
|||||||
// TODO: Select TreeView using sceneName
|
// TODO: Select TreeView using sceneName
|
||||||
ui_->qtk__TreeView->updateView(getQtkWidget()->getScene());
|
ui_->qtk__TreeView->updateView(getQtkWidget()->getScene());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::setScene(Qtk::Scene * scene)
|
||||||
|
{
|
||||||
|
connect(scene,
|
||||||
|
&Qtk::Scene::sceneUpdated,
|
||||||
|
MainWindow::getMainWindow(),
|
||||||
|
&MainWindow::refreshScene);
|
||||||
|
ui_->qtk__QtkWidget->setScene(scene);
|
||||||
|
}
|
||||||
|
@ -96,6 +96,11 @@ class MainWindow : public QMainWindow
|
|||||||
*/
|
*/
|
||||||
Qtk::QtkWidget * getQtkWidget(const QString & name);
|
Qtk::QtkWidget * getQtkWidget(const QString & name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param scene The new scene to view.
|
||||||
|
*/
|
||||||
|
void setScene(Qtk::Scene * scene);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
* Trigger a refresh for widgets related to a scene that has been updated.
|
* Trigger a refresh for widgets related to a scene that has been updated.
|
||||||
|
@ -133,10 +133,6 @@ void QtkWidget::setScene(Scene * scene)
|
|||||||
{
|
{
|
||||||
if (mScene != Q_NULLPTR) {
|
if (mScene != Q_NULLPTR) {
|
||||||
delete mScene;
|
delete mScene;
|
||||||
connect(scene,
|
|
||||||
&Scene::sceneUpdated,
|
|
||||||
MainWindow::getMainWindow(),
|
|
||||||
&MainWindow::refreshScene);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mScene = scene;
|
mScene = scene;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user