From 0f17c6a98fc16fd5c1c0eefc6bd62bcf066564de Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Wed, 17 Mar 2021 22:13:10 -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 (manually cherry picked from commit 27ba830b8ef513c8332e15747797844a97807791) --- src/frontends/qt4/GuiSearch.cpp | 3 +++ src/frontends/qt4/ui/BibtexUi.ui | 3 --- src/frontends/qt4/ui/ListingsUi.ui | 9 --------- src/frontends/qt4/ui/SearchUi.ui | 6 ------ src/frontends/qt4/ui/SendtoUi.ui | 3 --- src/frontends/qt4/ui/SpellcheckerUi.ui | 3 --- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/frontends/qt4/GuiSearch.cpp b/src/frontends/qt4/GuiSearch.cpp index 411ba2ef10..294849ca4a 100644 --- a/src/frontends/qt4/GuiSearch.cpp +++ b/src/frontends/qt4/GuiSearch.cpp @@ -62,6 +62,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/qt4/ui/BibtexUi.ui b/src/frontends/qt4/ui/BibtexUi.ui index f72ba6ce29..79745ee0b6 100644 --- a/src/frontends/qt4/ui/BibtexUi.ui +++ b/src/frontends/qt4/ui/BibtexUi.ui @@ -135,9 +135,6 @@ true - - true - false diff --git a/src/frontends/qt4/ui/ListingsUi.ui b/src/frontends/qt4/ui/ListingsUi.ui index 0c89d17270..ad1781c1bc 100644 --- a/src/frontends/qt4/ui/ListingsUi.ui +++ b/src/frontends/qt4/ui/ListingsUi.ui @@ -171,9 +171,6 @@ false - - true - false @@ -217,9 +214,6 @@ false - - true - false @@ -254,9 +248,6 @@ false - - true - false diff --git a/src/frontends/qt4/ui/SearchUi.ui b/src/frontends/qt4/ui/SearchUi.ui index 7fc1e31739..68616e95c3 100644 --- a/src/frontends/qt4/ui/SearchUi.ui +++ b/src/frontends/qt4/ui/SearchUi.ui @@ -52,9 +52,6 @@ QComboBox::InsertAtTop - - false - false @@ -87,9 +84,6 @@ QComboBox::InsertAtTop - - false - false diff --git a/src/frontends/qt4/ui/SendtoUi.ui b/src/frontends/qt4/ui/SendtoUi.ui index 7626a855ca..cd0e55f2e5 100644 --- a/src/frontends/qt4/ui/SendtoUi.ui +++ b/src/frontends/qt4/ui/SendtoUi.ui @@ -50,9 +50,6 @@ QComboBox::NoInsert - - true - false diff --git a/src/frontends/qt4/ui/SpellcheckerUi.ui b/src/frontends/qt4/ui/SpellcheckerUi.ui index c8d6a863b9..5c09d13a61 100644 --- a/src/frontends/qt4/ui/SpellcheckerUi.ui +++ b/src/frontends/qt4/ui/SpellcheckerUi.ui @@ -110,9 +110,6 @@ QComboBox::InsertAtTop - - true - false