Skip to content

Commit

Permalink
Fix empty editors after closing them and creating a new project (LMMS…
Browse files Browse the repository at this point in the history
  • Loading branch information
necrashter authored and PhysSong committed Mar 19, 2019
1 parent ea1e7c3 commit 07da8ad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Editor : public QMainWindow
DropToolBar * addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & windowTitle);
DropToolBar * addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle);

virtual void closeEvent( QCloseEvent * _ce );
protected slots:
virtual void play() {}
virtual void record() {}
Expand Down
18 changes: 16 additions & 2 deletions src/gui/editors/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QAction>
#include <QMdiArea>
#include <QShortcut>
#include <QCloseEvent>


void Editor::setPauseIcon(bool displayPauseIcon)
Expand Down Expand Up @@ -121,8 +122,18 @@ QAction *Editor::playAction() const
return m_playAction;
}



void Editor::closeEvent( QCloseEvent * _ce )
{
if( parentWidget() )
{
parentWidget()->hide();
}
else
{
hide();
}
_ce->ignore();
}

DropToolBar::DropToolBar(QWidget* parent) : QToolBar(parent)
{
Expand All @@ -138,3 +149,6 @@ void DropToolBar::dropEvent(QDropEvent* event)
{
dropped(event);
}



0 comments on commit 07da8ad

Please sign in to comment.