tycho: fix activeProject returning the wrong object
parent
82d0d378b0
commit
cb9d844404
|
@ -81,6 +81,8 @@ void Menu::updateActions()
|
||||||
bool active = view != nullptr;
|
bool active = view != nullptr;
|
||||||
|
|
||||||
ui->actionMapProps->setEnabled(active);
|
ui->actionMapProps->setEnabled(active);
|
||||||
|
|
||||||
|
dbgPrintFunc();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::closeEvent(QCloseEvent *event)
|
void Menu::closeEvent(QCloseEvent *event)
|
||||||
|
@ -97,8 +99,7 @@ void Menu::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
ProjectView *Menu::activeProject() const
|
ProjectView *Menu::activeProject() const
|
||||||
{
|
{
|
||||||
auto win = activeSubWindow();
|
return qobject_cast<ProjectView *>(activeSubWindow());
|
||||||
return win ? qobject_cast<ProjectView *>(win->widget()) : nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QMdiSubWindow *Menu::activeSubWindow() const
|
QMdiSubWindow *Menu::activeSubWindow() const
|
||||||
|
|
|
@ -13,7 +13,7 @@ ProjectModel::~ProjectModel()
|
||||||
|
|
||||||
bool ProjectModel::isDirty() const
|
bool ProjectModel::isDirty() const
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProjectModel::open(const QString &fname)
|
bool ProjectModel::open(const QString &fname)
|
||||||
|
|
Loading…
Reference in New Issue