]> git.lyx.org Git - features.git/commit
Fix Qt deprecation warns for setting tab
authorScott Kostyshak <skostysh@lyx.org>
Sun, 8 Mar 2020 15:16:28 +0000 (11:16 -0400)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:53 +0000 (15:48 +0200)
commit752ec9185c9c53139b9704826222718104aea872
tree1edf8ac657197024bb55793650017368b18028a3
parent79f5fe99192e1f045fded3448dec1ede24430ed0
Fix Qt deprecation warns for setting tab

Fix warnings coming from deprecations of QTextEdit::tabStopWidth()
and QFontMetrics::width(). Regarding tabStopWidth(), the ChangeLog
states the following [1]:

  Introduced tabStopDistance property in QTextOption, QTextEdit and
  QPlainTextEdit as replacement for the inconsistently named tabStop and
  tabStopWidth properties. QTextOption::tabStop, QTextEdit::tabStopWidth and
  QPlainTextEdit::tabStopWidth are now deprecated.

Note that QFontMetrics::horizontalAdvance() is what we want here, as
opposed to QFontMetrics::boundingRect(), because we want to know
where to draw the next character after the tab.

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.10.0/?h=v5.10.0
src/frontends/qt/GuiDocument.cpp