The branch, killqt4, has been updated.

- Log -----------------------------------------------------------------

commit db70aec26290902ff0076c0c20d3455451b880c7
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sat Nov 19 15:08:21 2022 +0100

    update release notes

diff --git a/TODO.killqt4 b/TODO.killqt4
index 86254fb..05e7bb3 100644
--- a/TODO.killqt4
+++ b/TODO.killqt4
@@ -5,7 +5,6 @@ Things left to do after killing Qt4 (obtained by grepping for 
Qt4 and 'Qt 4'):
 * update INSTALL.cmake
 * update INSTALL.MacOSX
 * update autoconf
-see also lib/RELEASE-NOTES
 * update cmake
 * check whether development/autotests/keytest.py really needs QT4
   investigate references to Qt4 in keytest
diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index 3c211a2..a99ac04 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -213,7 +213,8 @@
 !!Changes with respect to external programs and libraries in 2.4:
 
 * The Qt5 libraries are now used by default. In order to link against
-  Qt4 the configure option --disable-qt5 has to be used.
+  Qt6 the configure option --enable-qt6 has to be used. Qt4 is not 
+  supported anymore.
 
 * The dependency on pplatex/dvipost was dropped.
 

commit a3327f576ca4742963faa10b1a2962c3f4b21747
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sat Nov 19 15:04:38 2022 +0100

    Get rid of setSectionResizeMode helper functions.

diff --git a/src/frontends/qt/GuiCompleter.cpp 
b/src/frontends/qt/GuiCompleter.cpp
index 281ff35..2aee436 100644
--- a/src/frontends/qt/GuiCompleter.cpp
+++ b/src/frontends/qt/GuiCompleter.cpp
@@ -455,8 +455,8 @@ void GuiCompleter::asyncUpdatePopup()
        // has a bad memory about it and we have to tell him again and again.
        QTreeView * listView = static_cast<QTreeView *>(popup());
        listView->header()->setStretchLastSection(false);
-       setSectionResizeMode(listView->header(), 0, QHeaderView::Stretch);
-       setSectionResizeMode(listView->header(), 1, QHeaderView::Fixed);
+       listView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
+       listView->header()->setSectionResizeMode(1, QHeaderView::Fixed);
        listView->header()->resizeSection(1, 22);
 
        // show/update popup
diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index 8dff8b5..83581d0 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -1351,7 +1351,7 @@ GuiDocument::GuiDocument(GuiView & lv)
        numberingModule->tocTW->headerItem()->setText(0, qt_("Example"));
        numberingModule->tocTW->headerItem()->setText(1, qt_("Numbered"));
        numberingModule->tocTW->headerItem()->setText(2, qt_("Appears in TOC"));
-       setSectionResizeMode(numberingModule->tocTW->header(), 
QHeaderView::ResizeToContents);
+       
numberingModule->tocTW->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
        connect(numberingModule->linenoCB, SIGNAL(toggled(bool)),
                this, SLOT(linenoToggled(bool)));
        connect(numberingModule->linenoCB, SIGNAL(clicked()),
@@ -1441,7 +1441,7 @@ GuiDocument::GuiDocument(GuiView & lv)
        headers << qt_("Package") << qt_("Load automatically")
                << qt_("Load always") << qt_("Do not load");
        mathsModule->packagesTW->setHorizontalHeaderLabels(headers);
-       setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), 
QHeaderView::Stretch);
+       
mathsModule->packagesTW->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
        map<string, string> const & packages = BufferParams::auto_packages();
        mathsModule->packagesTW->setRowCount(packages.size());
        int packnum = 0;
@@ -1644,10 +1644,10 @@ GuiDocument::GuiDocument(GuiView & lv)
        // Modules
        modulesModule = new UiWidget<Ui::ModulesUi>(this);
        modulesModule->availableLV->header()->setVisible(false);
-       setSectionResizeMode(modulesModule->availableLV->header(), 
QHeaderView::ResizeToContents);
+       
modulesModule->availableLV->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
        modulesModule->availableLV->header()->setStretchLastSection(false);
        modulesModule->selectedLV->header()->setVisible(false);
-       setSectionResizeMode(modulesModule->selectedLV->header(), 
QHeaderView::ResizeToContents);
+       
modulesModule->selectedLV->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
        modulesModule->selectedLV->header()->setStretchLastSection(false);
        selectionManager =
                new ModuleSelectionManager(this, modulesModule->availableLV,
diff --git a/src/frontends/qt/PanelStack.cpp b/src/frontends/qt/PanelStack.cpp
index 745442b..c70c7ae 100644
--- a/src/frontends/qt/PanelStack.cpp
+++ b/src/frontends/qt/PanelStack.cpp
@@ -61,7 +61,7 @@ PanelStack::PanelStack(QWidget * parent)
        list_->setRootIsDecorated(false);
        list_->setColumnCount(1);
        list_->header()->hide();
-       setSectionResizeMode(list_->header(), QHeaderView::ResizeToContents);
+       list_->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
        list_->header()->setStretchLastSection(false);
        list_->setMinimumSize(list_->viewport()->size());
 
diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp
index a123035..6891c30 100644
--- a/src/frontends/qt/qt_helpers.cpp
+++ b/src/frontends/qt/qt_helpers.cpp
@@ -269,18 +269,6 @@ void setMessageColour(list<QWidget *> highlighted, 
list<QWidget *> plain)
 }
 
 
-/// FIXME KILLQT4: kill this function
-/// wrapper to hide the change of method name to setSectionResizeMode
-void setSectionResizeMode(QHeaderView * view,
-    int logicalIndex, QHeaderView::ResizeMode mode) {
-       view->setSectionResizeMode(logicalIndex, mode);
-}
-
-/// FIXME KILLQT4: kill this function
-void setSectionResizeMode(QHeaderView * view, QHeaderView::ResizeMode mode) {
-       view->setSectionResizeMode(mode);
-}
-
 void showDirectory(FileName const & directory)
 {
        if (!directory.exists())
diff --git a/src/frontends/qt/qt_helpers.h b/src/frontends/qt/qt_helpers.h
index 08d50fa..77c14b8 100644
--- a/src/frontends/qt/qt_helpers.h
+++ b/src/frontends/qt/qt_helpers.h
@@ -89,12 +89,6 @@ void focusAndHighlight(QAbstractItemView * w);
 void setMessageColour(std::list<QWidget *> highlighted,
                       std::list<QWidget *> plain);
 
-/// Qt5 changed setSectionMode to setSectionResizeMode
-/// These wrappers work for Qt4 and Qt5
-void setSectionResizeMode(QHeaderView * view,
-    int logicalIndex, QHeaderView::ResizeMode mode);
-void setSectionResizeMode(QHeaderView * view,
-       QHeaderView::ResizeMode mode);
 /// Shows a directory in OSs file browser
 void showDirectory(support::FileName const & directory);
 /// handle request for showing citation content - shows pdf/ps or

commit 11369131ee48f57ddece25e3c8400183cb0cbb68
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sat Nov 19 14:58:50 2022 +0100

    Remove workaround that was needed only by Qt4

diff --git a/src/frontends/qt/GuiFontMetrics.cpp 
b/src/frontends/qt/GuiFontMetrics.cpp
index bde48c0..b3bdac6 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -139,11 +139,6 @@ GuiFontMetrics::GuiFontMetrics(QFont const & font)
                        slope_ = defaultSlope;
                LYXERR(Debug::FONT, "Italic slope: " << slope_);
        }
-       // If those characters have a non-zero width, we need to avoid them.
-       // This happens with Qt4 with monospace fonts
-       needs_naked_ = width(QString() + QChar(0x2060) + QChar(0x202d) + 
QChar(0x202e)) > 0;
-       // if (needs_naked_)
-       //      LYXERR0("Font " << font.family() << " needs naked text 
layouts!");
 }
 
 
@@ -342,9 +337,7 @@ struct TextLayoutHelper
        /// Create the helper
        /// \c s is the original string
        /// \c isrtl is true if the string is right-to-left
-       /// \c naked is true to disable the insertion of zero width annotations
-       /// FIXME KILLQT4: remove \c naked argument when Qt4 support goes away.
-       TextLayoutHelper(docstring const & s, bool isrtl, bool naked = false);
+       TextLayoutHelper(docstring const & s, bool isrtl);
 
        /// translate QString index to docstring index
        docstring::size_type qpos2pos(int qpos) const
@@ -368,7 +361,7 @@ private:
 };
 
 
-TextLayoutHelper::TextLayoutHelper(docstring const & s, bool isrtl, bool naked)
+TextLayoutHelper::TextLayoutHelper(docstring const & s, bool isrtl)
        : docstr(s), rtl(isrtl)
 {
        // Reserve memory for performance purpose
@@ -384,16 +377,14 @@ TextLayoutHelper::TextLayoutHelper(docstring const & s, 
bool isrtl, bool naked)
         */
        // Unicode character WORD JOINER
        QChar const word_joiner(0x2060);
-       if (!naked)
-               qstr += word_joiner;
+       qstr += word_joiner;
 
 #ifdef BIDI_USE_OVERRIDE
        /* Unicode override characters enforce drawing direction
         * Source: http://www.iamcal.com/understanding-bidirectional-text/
         * Left-to-right override is 0x202d and right-to-left override is 
0x202e.
         */
-       if (!naked)
-               qstr += QChar(rtl ? 0x202e : 0x202d);
+       qstr += QChar(rtl ? 0x202e : 0x202d);
 #endif
 
        // Now translate the string character-by-character.
@@ -401,7 +392,7 @@ TextLayoutHelper::TextLayoutHelper(docstring const & s, 
bool isrtl, bool naked)
        for (char_type const c : s) {
                // insert a word joiner character between consecutive spaces
                bool const is_space = isSpace(c);
-               if (!naked && is_space && was_space)
+               if (is_space && was_space)
                        qstr += word_joiner;
                was_space = is_space;
                // Remember the QString index at this point
@@ -414,8 +405,7 @@ TextLayoutHelper::TextLayoutHelper(docstring const & s, 
bool isrtl, bool naked)
        }
 
        // Final word joiner (see above)
-       if (!naked)
-               qstr += word_joiner;
+       qstr += word_joiner;
 
        // Add virtual position at the end of the string
        pos2qpos_.push_back(qstr.size());
@@ -476,7 +466,7 @@ GuiFontMetrics::getTextLayout(docstring const & s, bool 
const rtl,
        if (auto ptl = qtextlayout_cache_[key])
                return ptl;
        PROFILE_CACHE_MISS(getTextLayout);
-       TextLayoutHelper tlh(s, rtl, needs_naked_);
+       TextLayoutHelper tlh(s, rtl);
        auto const ptl = getTextLayout_helper(tlh, wordspacing, font_);
        qtextlayout_cache_.insert(key, ptl);
        return ptl;
@@ -486,7 +476,7 @@ GuiFontMetrics::getTextLayout(docstring const & s, bool 
const rtl,
 int GuiFontMetrics::pos2x(docstring const & s, int pos, bool const rtl,
                           double const wordspacing) const
 {
-       TextLayoutHelper tlh(s, rtl, needs_naked_);
+       TextLayoutHelper tlh(s, rtl);
        auto ptl = getTextLayout(tlh, wordspacing);
        // pos can be negative, see #10506.
        int const qpos = tlh.pos2qpos(max(pos, 0));
@@ -497,7 +487,7 @@ int GuiFontMetrics::pos2x(docstring const & s, int pos, 
bool const rtl,
 int GuiFontMetrics::x2pos(docstring const & s, int & x, bool const rtl,
                           double const wordspacing) const
 {
-       TextLayoutHelper tlh(s, rtl, needs_naked_);
+       TextLayoutHelper tlh(s, rtl);
        auto ptl = getTextLayout(tlh, wordspacing);
        QTextLine const & tline = ptl->lineForTextPosition(0);
        int qpos = tline.xToCursor(x);
@@ -535,7 +525,7 @@ FontMetrics::Breaks
 GuiFontMetrics::breakString_helper(docstring const & s, int first_wid, int wid,
                                    bool rtl, bool force) const
 {
-       TextLayoutHelper const tlh(s, rtl, needs_naked_);
+       TextLayoutHelper const tlh(s, rtl);
 
        QTextLayout tl;
 #ifdef BIDI_USE_FLAG
diff --git a/src/frontends/qt/GuiFontMetrics.h 
b/src/frontends/qt/GuiFontMetrics.h
index ff2f0a3..5c32ea9 100644
--- a/src/frontends/qt/GuiFontMetrics.h
+++ b/src/frontends/qt/GuiFontMetrics.h
@@ -119,10 +119,6 @@ private:
        /// Slope of italic font
        double slope_;
 
-       /// If true, avoid extra annotation in string for QTextLayout
-       // FIXME KILLQT4: remove when Qt4 suport goes away
-       bool needs_naked_ = false;
-
        /// Cache of char widths
        mutable QHash<char_type, int> width_cache_;
        /// Cache of string widths

commit 0f8b4e36d80d4513d796aa80a112dee06ea4ae91
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sat Nov 19 14:55:33 2022 +0100

    Remove old workaround that was needed for Qt 4.2
    
    Jürgen believes that this is not needed anymore.

diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index ff6c2df..8dff8b5 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -1783,10 +1783,6 @@ GuiDocument::GuiDocument(GuiView & lv)
        docPS->addPanel(outputModule, N_("Formats[[output]]"));
        docPS->addPanel(preambleModule, N_("LaTeX Preamble"));
        docPS->setCurrentPanel("Document Class");
-// FIXME KILLQT4: check that this is still needed (is this workaround still 
needed?)
-// FIXME: hack to work around resizing bug in Qt >= 4.2
-// bug verified with Qt 4.2.{0-3} (JSpitzm)
-       docPS->updateGeometry();
 }
 
 
diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp
index 9697902..c72baee 100644
--- a/src/frontends/qt/GuiPrefs.cpp
+++ b/src/frontends/qt/GuiPrefs.cpp
@@ -3568,10 +3568,6 @@ GuiPreferences::GuiPreferences(GuiView & lv)
        addModule(formats);
 
        prefsPS->setCurrentPanel("User Interface");
-// FIXME KILLQT4: check that this is still needed (what bug is it?)
-// FIXME: hack to work around resizing bug in Qt >= 4.2
-// bug verified with Qt 4.2.{0-3} (JSpitzm)
-       prefsPS->updateGeometry();
 
        bc().setPolicy(ButtonPolicy::PreferencesPolicy);
        bc().setOK(buttonBox->button(QDialogButtonBox::Ok));

-----------------------------------------------------------------------

Summary of changes:
 TODO.killqt4                        |    1 -
 lib/RELEASE-NOTES                   |    3 ++-
 src/frontends/qt/GuiCompleter.cpp   |    4 ++--
 src/frontends/qt/GuiDocument.cpp    |   12 ++++--------
 src/frontends/qt/GuiFontMetrics.cpp |   30 ++++++++++--------------------
 src/frontends/qt/GuiFontMetrics.h   |    4 ----
 src/frontends/qt/GuiPrefs.cpp       |    4 ----
 src/frontends/qt/PanelStack.cpp     |    2 +-
 src/frontends/qt/qt_helpers.cpp     |   12 ------------
 src/frontends/qt/qt_helpers.h       |    6 ------
 10 files changed, 19 insertions(+), 59 deletions(-)


hooks/post-receive
-- 
Repository for new features
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to