]> git.lyx.org Git - lyx.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)
committerScott Kostyshak <skostysh@lyx.org>
Sun, 8 Mar 2020 15:48:54 +0000 (11:48 -0400)
commit2cfcd706ab92f0e4175f40ed931293802cd5a623
treea274abde76983ed58d268af47fcda21b8d907714
parent0885098bd3c07ca71024c4fe1bc7d6a1879918f6
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