fix Qt6.10 incompatibility (color issue + change in QSortFilterProxy) #LINQT-2355

This commit is contained in:
Gaelle Braud 2026-01-21 10:32:45 +01:00
parent 7a86e5db14
commit 67b8abd0a0
4 changed files with 71 additions and 44 deletions

View file

@ -110,7 +110,12 @@ void ParticipantProxy::setShowMe(const bool &show) {
if (list->mShowMe != show) {
list->mShowMe = show;
emit showMeChanged();
invalidateFilter();
#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
QSortFilterProxyModel::invalidateFilter();
#else
QSortFilterProxyModel::beginFilterChange();
QSortFilterProxyModel::endFilterChange();
#endif
}
}

View file

@ -43,7 +43,14 @@ void LimitProxy::setSourceModels(SortFilterProxy *firstList) {
if (secondList) {
connect(secondList, &QAbstractItemModel::rowsInserted, this, &LimitProxy::onAdded);
connect(secondList, &QAbstractItemModel::rowsRemoved, this, &LimitProxy::onRemoved);
connect(secondList, &QAbstractItemModel::modelReset, this, &LimitProxy::invalidateRowsFilter);
connect(secondList, &QAbstractItemModel::modelReset, this, [this] {
#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
QSortFilterProxyModel::invalidateRowsFilter();
#else
QSortFilterProxyModel::beginFilterChange();
QSortFilterProxyModel::endFilterChange();
#endif
});
}
connect(firstList, &SortFilterProxy::filterTextChanged, this, &LimitProxy::filterTextChanged);
connect(firstList, &SortFilterProxy::filterTypeChanged, this, &LimitProxy::filterTypeChanged);
@ -110,7 +117,12 @@ void LimitProxy::setMaxDisplayItems(int maxItems) {
emit maxDisplayItemsChanged();
if (model && getDisplayCount(modelCount) != oldCount) {
invalidateFilter();
#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
QSortFilterProxyModel::invalidateFilter();
#else
QSortFilterProxyModel::beginFilterChange();
QSortFilterProxyModel::endFilterChange();
#endif
}
}
}
@ -169,6 +181,11 @@ void LimitProxy::onAdded() {
void LimitProxy::onRemoved() {
int count = sourceModel()->rowCount();
if (mMaxDisplayItems > 0 && mMaxDisplayItems <= count) {
invalidateFilter();
#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
QSortFilterProxyModel::invalidateFilter();
#else
QSortFilterProxyModel::beginFilterChange();
QSortFilterProxyModel::endFilterChange();
#endif
}
}

View file

@ -76,7 +76,7 @@ QString SortFilterProxy::getFilterText() const {
void SortFilterProxy::setFilterText(const QString &filter) {
if (mFilterText != filter) {
mFilterText = filter;
invalidateFilter();
SortFilterProxy::invalidateFilter();
emit filterTextChanged();
}
}
@ -90,5 +90,10 @@ void SortFilterProxy::remove(int index, int count) {
}
void SortFilterProxy::invalidateFilter() {
#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
QSortFilterProxyModel::invalidateFilter();
#else
QSortFilterProxyModel::beginFilterChange();
QSortFilterProxyModel::endFilterChange();
#endif
}

View file

@ -2,46 +2,46 @@ pragma Singleton
import QtQuick
QtObject {
property color main1_100: "#FFEACB"
property color main1_200: "#FFD098"
property color main1_300: "#FFB266"
property color main1_500_main: "#FE5E00"
property color main1_600: "#DA4400"
property color main1_700: "#B72D00"
property var main1_100: "#FFEACB"
property var main1_200: "#FFD098"
property var main1_300: "#FFB266"
property var main1_500_main: "#FE5E00"
property var main1_600: "#DA4400"
property var main1_700: "#B72D00"
property color main2_0: "#FAFEFF"
property color main2_100: "#EEF6F8"
property color main2_200: "#DFECF2"
property color main2_300: "#C0D1D9"
property color main2_400: "#9AABB5"
property color main2_500main: "#6C7A87"
property color main2_600: "#4E6074"
property color main2_700: "#364860"
property color main2_800: "#22334D"
property color main2_900: "#2D3648"
property var main2_0: "#FAFEFF"
property var main2_100: "#EEF6F8"
property var main2_200: "#DFECF2"
property var main2_300: "#C0D1D9"
property var main2_400: "#9AABB5"
property var main2_500main: "#6C7A87"
property var main2_600: "#4E6074"
property var main2_700: "#364860"
property var main2_800: "#22334D"
property var main2_900: "#2D3648"
property color grey_0: "#FFFFFF"
property color grey_100: "#F9F9F9"
property color grey_200: "#EDEDED"
property color grey_300: "#C9C9C9"
property color grey_400: "#949494"
property color grey_500: "#4E4E4E"
property color grey_600: "#2E3030"
property color grey_850: "#D9D9D9"
property color grey_900: "#070707"
property color grey_1000: "#000000"
property var grey_0: "#FFFFFF"
property var grey_100: "#F9F9F9"
property var grey_200: "#EDEDED"
property var grey_300: "#C9C9C9"
property var grey_400: "#949494"
property var grey_500: "#4E4E4E"
property var grey_600: "#2E3030"
property var grey_850: "#D9D9D9"
property var grey_900: "#070707"
property var grey_1000: "#000000"
property color warning_600: "#DBB820"
property color danger_500main: "#DD5F5F"
property color danger_700: "#9E3548"
property color danger_900: "#723333"
property color success_500main: "#4FAE80"
property color success_700: "#377d71"
property color success_900: "#1E4C53"
property color info_500_main: "#4AA8FF"
property var warning_600: "#DBB820"
property var danger_500main: "#DD5F5F"
property var danger_700: "#9E3548"
property var danger_900: "#723333"
property var success_500main: "#4FAE80"
property var success_700: "#377d71"
property var success_900: "#1E4C53"
property var info_500_main: "#4AA8FF"
property color vue_meter_light_green: "#6FF88D"
property color vue_meter_dark_green: "#00D916"
property var vue_meter_light_green: "#6FF88D"
property var vue_meter_dark_green: "#00D916"
property real defaultHeight: 1080.0
property real defaultWidth: 1920.0
@ -56,10 +56,10 @@ QtObject {
property string flagFont: "OpenMoji Color"
property string defaultFont: "Noto Sans"
property color numericPadPressedButtonColor: "#EEF7F8"
property var numericPadPressedButtonColor: "#EEF7F8"
property color groupCallButtonColor: "#EEF7F8"
property var groupCallButtonColor: "#EEF7F8"
property color placeholders: '#CACACA' // No name in design
property var placeholders: '#CACACA' // No name in design
}