diff --git a/qt/DetectorTableModel.cpp b/qt/DetectorTableModel.cpp index 67388740..b53ffbc3 100644 --- a/qt/DetectorTableModel.cpp +++ b/qt/DetectorTableModel.cpp @@ -146,10 +146,13 @@ void DetectorTableModel::applySettings() ResourceManager::get()->GetSettingsManager()->SaveSettings(); } -void DetectorTableModel::toggleAll(const bool state) +void DetectorTableModel::toggleAll(const bool state, QSortFilterProxyModel* detectorSortModel) { for(unsigned int detector_idx = 0; detector_idx < detectors.size(); detector_idx++) { - setData(index(detector_idx,1), state, Qt::CheckStateRole); + if(detectorSortModel->mapFromSource(index(detector_idx, 0)).isValid()) + { + setData(index(detector_idx,1), state, Qt::CheckStateRole); + } } } diff --git a/qt/DetectorTableModel.h b/qt/DetectorTableModel.h index 6592d094..1f47beec 100644 --- a/qt/DetectorTableModel.h +++ b/qt/DetectorTableModel.h @@ -1,6 +1,7 @@ #ifndef DETECTORTABLEMODEL_H #define DETECTORTABLEMODEL_H +#include #include #include "ResourceManager.h" @@ -28,7 +29,7 @@ public: public slots: void applySettings(); - void toggleAll(const bool state); + void toggleAll(const bool state, QSortFilterProxyModel* detectorSortModel); }; #endif // DETECTORTABLEMODEL_H diff --git a/qt/OpenRGBSupportedDevicesPage.cpp b/qt/OpenRGBSupportedDevicesPage.cpp index 9bae083c..77705ec4 100644 --- a/qt/OpenRGBSupportedDevicesPage.cpp +++ b/qt/OpenRGBSupportedDevicesPage.cpp @@ -64,5 +64,5 @@ void OpenRGBSupportedDevicesPage::on_Filter_textChanged(const QString &arg1) void OpenRGBSupportedDevicesPage::on_ToggleAllCheckbox_toggled(const bool checked) { - detectorTableModel->toggleAll(checked); + detectorTableModel->toggleAll(checked, detectorSortModel); }