From 27ba830b8ef513c8332e15747797844a97807791 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Wed, 18 Mar 2020 21:00:09 -0400 Subject: [PATCH] Fix Qt deprecation warns for setAutoCompletion() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/frontends/qt/GuiSearch.cpp | 3 +++ src/frontends/qt/ui/BibtexUi.ui | 3 --- src/frontends/qt/ui/ListingsUi.ui | 9 --------- src/frontends/qt/ui/SearchUi.ui | 6 ------ src/frontends/qt/ui/SendtoUi.ui | 3 --- src/frontends/qt/ui/SpellcheckerUi.ui | 3 --- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp index 4e0c354fc6..3fffb6ea2b 100644 --- a/src/frontends/qt/GuiSearch.cpp +++ b/src/frontends/qt/GuiSearch.cpp @@ -69,6 +69,9 @@ GuiSearch::GuiSearch(GuiView & lv) bc().addReadOnly(replacePB); bc().addReadOnly(replaceallPB); + findCO->setCompleter(0); + replaceCO->setCompleter(0); + replacePB->setEnabled(false); replaceallPB->setEnabled(false); } diff --git a/src/frontends/qt/ui/BibtexUi.ui b/src/frontends/qt/ui/BibtexUi.ui index 1439e1864e..3eac510d8f 100644 --- a/src/frontends/qt/ui/BibtexUi.ui +++ b/src/frontends/qt/ui/BibtexUi.ui @@ -277,9 +277,6 @@ true - - true - false diff --git a/src/frontends/qt/ui/ListingsUi.ui b/src/frontends/qt/ui/ListingsUi.ui index 7eaf66544a..330964936b 100644 --- a/src/frontends/qt/ui/ListingsUi.ui +++ b/src/frontends/qt/ui/ListingsUi.ui @@ -176,9 +176,6 @@ false - - true - false @@ -223,9 +220,6 @@ false - - true - false @@ -258,9 +252,6 @@ false - - true - false diff --git a/src/frontends/qt/ui/SearchUi.ui b/src/frontends/qt/ui/SearchUi.ui index 8a94abb0ed..f0b78ccc3c 100644 --- a/src/frontends/qt/ui/SearchUi.ui +++ b/src/frontends/qt/ui/SearchUi.ui @@ -57,9 +57,6 @@ QComboBox::InsertAtTop - - false - false @@ -92,9 +89,6 @@ QComboBox::InsertAtTop - - false - false diff --git a/src/frontends/qt/ui/SendtoUi.ui b/src/frontends/qt/ui/SendtoUi.ui index 4cd8ef4f75..4e599b7356 100644 --- a/src/frontends/qt/ui/SendtoUi.ui +++ b/src/frontends/qt/ui/SendtoUi.ui @@ -58,9 +58,6 @@ QComboBox::NoInsert - - true - false diff --git a/src/frontends/qt/ui/SpellcheckerUi.ui b/src/frontends/qt/ui/SpellcheckerUi.ui index 1b66dc9d40..18cd17d18e 100644 --- a/src/frontends/qt/ui/SpellcheckerUi.ui +++ b/src/frontends/qt/ui/SpellcheckerUi.ui @@ -34,9 +34,6 @@ QComboBox::InsertAtTop - - true - false