mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2024-11-21 15:57:25 -06:00
don't try to perform assignable setting copying when device view is out
of focus This fixes a bug where the first assignable setting in the profile would be copied to selected nodes, even if they were incompatible
This commit is contained in:
parent
a099765e4e
commit
1759ecaa51
@ -4,6 +4,7 @@
|
||||
#include <DragChartView.hpp>
|
||||
#include <Globals.hpp>
|
||||
#include <patterns.hpp>
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QDebug>
|
||||
#include <QHeaderView>
|
||||
@ -33,6 +34,15 @@ DeviceTreeView::DeviceTreeView(QWidget *parent) : QTreeView(parent) {
|
||||
resumeChildren(index);
|
||||
});
|
||||
|
||||
// Semi-hack: don't try to copy assignable settings from indices when loading profile
|
||||
auto app = static_cast<QApplication *>(QApplication::instance());
|
||||
connect(app, &QApplication::focusChanged, [=](QWidget *, QWidget *now) {
|
||||
if (now && !this->geometry().contains(now->geometry())) {
|
||||
m_editSelection = {};
|
||||
m_editedIndex = QModelIndex{};
|
||||
clearSelection();
|
||||
}
|
||||
});
|
||||
m_delegate = new DeviceModelDelegate(this);
|
||||
|
||||
setItemDelegate(m_delegate);
|
||||
|
Loading…
Reference in New Issue
Block a user