Fix Qt deprecation warns for setAutoCompletion()

This commit fixes a few warnings from Qt 5.14 like the following
one:

  error: ‘void QComboBox::setAutoCompletion(bool)’ is deprecated: Use setCompleter() instead. [-Werror=deprecated-declarations]

We only generated setAutoCompletion() from setting the property in
the .ui files. There does not seem to be a .ui file property that
generates setCompleter(). However, the default in both Qt5 [1] and
Qt4 [2] is to enable case-insensitive autocompletion, which seems to
be the same type of autocompletion as when we were relying on
setAutoCompletion(true). Thus, we can remove the properties that set
autocomplete to true. There is only one file, SearchUi.ui, where we
were turning off the autocompletion; we now do so using
setCompleter(0) in GuiSearch::GuiSearch().

[1] https://doc.qt.io/qt-5/qcombobox.html#setCompleter
[2] https://doc.qt.io/archives/qt-4.8/qcombobox.html#setCompleter

(manually cherry picked from commit 27ba830b8e)
This commit is contained in:
Scott Kostyshak 2021-03-17 22:13:10 -04:00
parent 847312daea
commit 0f17c6a98f
6 changed files with 3 additions and 24 deletions

View File

@ -62,6 +62,9 @@ GuiSearch::GuiSearch(GuiView & lv)
bc().addReadOnly(replacePB); bc().addReadOnly(replacePB);
bc().addReadOnly(replaceallPB); bc().addReadOnly(replaceallPB);
findCO->setCompleter(0);
replaceCO->setCompleter(0);
replacePB->setEnabled(false); replacePB->setEnabled(false);
replaceallPB->setEnabled(false); replaceallPB->setEnabled(false);
} }

View File

@ -135,9 +135,6 @@
<property name="editable"> <property name="editable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="autoCompletion">
<bool>true</bool>
</property>
<property name="duplicatesEnabled"> <property name="duplicatesEnabled">
<bool>false</bool> <bool>false</bool>
</property> </property>

View File

@ -171,9 +171,6 @@
<property name="editable" > <property name="editable" >
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="autoCompletion" >
<bool>true</bool>
</property>
<property name="duplicatesEnabled" > <property name="duplicatesEnabled" >
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -217,9 +214,6 @@
<property name="editable" > <property name="editable" >
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="autoCompletion" >
<bool>true</bool>
</property>
<property name="duplicatesEnabled" > <property name="duplicatesEnabled" >
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -254,9 +248,6 @@
<property name="editable" > <property name="editable" >
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="autoCompletion" >
<bool>true</bool>
</property>
<property name="duplicatesEnabled" > <property name="duplicatesEnabled" >
<bool>false</bool> <bool>false</bool>
</property> </property>

View File

@ -52,9 +52,6 @@
<property name="insertPolicy"> <property name="insertPolicy">
<enum>QComboBox::InsertAtTop</enum> <enum>QComboBox::InsertAtTop</enum>
</property> </property>
<property name="autoCompletion">
<bool>false</bool>
</property>
<property name="duplicatesEnabled"> <property name="duplicatesEnabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -87,9 +84,6 @@
<property name="insertPolicy"> <property name="insertPolicy">
<enum>QComboBox::InsertAtTop</enum> <enum>QComboBox::InsertAtTop</enum>
</property> </property>
<property name="autoCompletion">
<bool>false</bool>
</property>
<property name="duplicatesEnabled"> <property name="duplicatesEnabled">
<bool>false</bool> <bool>false</bool>
</property> </property>

View File

@ -50,9 +50,6 @@
<property name="insertPolicy" > <property name="insertPolicy" >
<enum>QComboBox::NoInsert</enum> <enum>QComboBox::NoInsert</enum>
</property> </property>
<property name="autoCompletion" >
<bool>true</bool>
</property>
<property name="duplicatesEnabled" > <property name="duplicatesEnabled" >
<bool>false</bool> <bool>false</bool>
</property> </property>

View File

@ -110,9 +110,6 @@
<property name="insertPolicy" > <property name="insertPolicy" >
<enum>QComboBox::InsertAtTop</enum> <enum>QComboBox::InsertAtTop</enum>
</property> </property>
<property name="autoCompletion" >
<bool>true</bool>
</property>
<property name="duplicatesEnabled" > <property name="duplicatesEnabled" >
<bool>false</bool> <bool>false</bool>
</property> </property>