drag-and-drop #14
|
@ -76,5 +76,5 @@ Qtk::QtkWidget * MainWindow::getQtkWidget(const QString & name) {
|
|||
|
||||
void MainWindow::refreshScene(QString sceneName) {
|
||||
// TODO: Select TreeView using sceneName>
|
||||
ui_->qtk__TreeView->updateView(getQtkWidget(sceneName)->getScene());
|
||||
ui_->qtk__TreeView->updateView(getQtkWidget()->getScene());
|
||||
}
|
||||
|
|
|
@ -108,7 +108,13 @@ void QtkWidget::paintGL() {
|
|||
}
|
||||
|
||||
void QtkWidget::setScene(Qtk::Scene * scene) {
|
||||
delete mScene;
|
||||
if (mScene != Q_NULLPTR) {
|
||||
delete mScene;
|
||||
connect(
|
||||
scene, &Qtk::Scene::sceneUpdated, MainWindow::getMainWindow(),
|
||||
&MainWindow::refreshScene);
|
||||
}
|
||||
|
||||
mScene = scene;
|
||||
if(mScene != Q_NULLPTR) {
|
||||
mConsole->setTitle(mScene->getSceneName());
|
||||
|
|
|
@ -45,7 +45,7 @@ void Qtk::TreeView::updateView(const Qtk::Scene * scene) {
|
|||
void Qtk::TreeView::itemFocus(QTreeWidgetItem * item, int column) {
|
||||
QString name = item->text(column);
|
||||
auto scene =
|
||||
MainWindow::getMainWindow()->getQtkWidget(mSceneName)->getScene();
|
||||
MainWindow::getMainWindow()->getQtkWidget()->getScene();
|
||||
auto & transform = scene->getCamera().getTransform();
|
||||
auto object = scene->getObject(name);
|
||||
if (object == Q_NULLPTR) {
|
||||
|
|
Loading…
Reference in New Issue