Skip to content
Snippets Groups Projects
Commit 81425691 authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

resolved new-project bug: no more duplications

parent 2728fcbd
No related branches found
No related tags found
1 merge request!2387unify code for list views
Pipeline #131170 failed
......@@ -25,7 +25,6 @@
#include "GUI/View/Widget/ItemViewOverlayButtons.h"
#include "GUI/View/Widget/ListItemDelegate.h"
#include <QMessageBox>
#include <QThread>
InstrumentsQListView::InstrumentsQListView()
: m_model(new InstrumentsQModel)
......@@ -66,6 +65,7 @@ InstrumentsQListView::InstrumentsQListView()
emit gDoc->instruments()->setChanged();
});
disconnect(gDoc->instruments(), &InstrumentsSet::setChanged, nullptr, nullptr);
connect(gDoc->instruments(), &InstrumentsSet::setChanged, [this] {
setCurrentIndex(m_model->index(gDoc->instruments()->currentIndex(), 0));
repaint();
......@@ -74,6 +74,12 @@ InstrumentsQListView::InstrumentsQListView()
setContextMenuPolicy(Qt::ActionsContextMenu);
}
InstrumentsQListView::~InstrumentsQListView()
{
disconnect(this, nullptr, nullptr, nullptr);
delete m_model;
}
QSize InstrumentsQListView::sizeHint() const
{
return {170, 400};
......
......@@ -26,6 +26,7 @@ class InstrumentsQListView : public QListView {
Q_OBJECT
public:
InstrumentsQListView();
~InstrumentsQListView();
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment