Qt: Better handle sort restriction
Setting sorting enabled/disabled resorts the list. If this happens too often, sometimes it can lead to the physical view models not present anymore and therefore crashing. Ping #18159
This commit is contained in:
parent
4ed4678859
commit
b6226cb136
|
@ -284,7 +284,11 @@ PacketList::PacketList(QWidget *parent) :
|
|||
connect(packet_list_model_, SIGNAL(itemHeightChanged(const QModelIndex&)), this, SLOT(updateRowHeights(const QModelIndex&)));
|
||||
connect(mainApp, SIGNAL(addressResolutionChanged()), this, SLOT(redrawVisiblePacketsDontSelectCurrent()));
|
||||
connect(mainApp, SIGNAL(columnDataChanged()), this, SLOT(redrawVisiblePacketsDontSelectCurrent()));
|
||||
connect(mainApp, &MainApplication::preferencesChanged, this, [=]() { setSortingEnabled(prefs.gui_packet_list_sortable); });
|
||||
connect(mainApp, &MainApplication::preferencesChanged, this, [=]() {
|
||||
if ((bool) (prefs.gui_packet_list_sortable) != isSortingEnabled()) {
|
||||
setSortingEnabled(prefs.gui_packet_list_sortable);
|
||||
}
|
||||
});
|
||||
|
||||
connect(header(), SIGNAL(sectionResized(int,int,int)),
|
||||
this, SLOT(sectionResized(int,int,int)));
|
||||
|
|
Loading…
Reference in New Issue