From be6a5e2f13ebf597317730cc22e4b62edaa6d06a Mon Sep 17 00:00:00 2001 From: BlueGreenMagick <50060875+BlueGreenMagick@users.noreply.github.com> Date: Wed, 29 Apr 2020 10:13:16 +0900 Subject: [PATCH] Set tab width to 4 spaces setTabStopWidth is deprecated, and setTabStopDistance is preferred It's not entirely accurate however, which you can see when you compare 10 tabs and 40 spaces --- qt/aqt/clayout.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qt/aqt/clayout.py b/qt/aqt/clayout.py index d95ef635d..22ca8f172 100644 --- a/qt/aqt/clayout.py +++ b/qt/aqt/clayout.py @@ -307,9 +307,10 @@ Please create a new card type first.""" self.tform.front.setAcceptRichText(False) self.tform.css.setAcceptRichText(False) self.tform.back.setAcceptRichText(False) - self.tform.front.setTabStopWidth(30) - self.tform.css.setTabStopWidth(30) - self.tform.back.setTabStopWidth(30) + tab_width = self.fontMetrics().width(" " * 4) + self.tform.front.setTabStopDistance(tab_width) + self.tform.css.setTabStopDistance(tab_width) + self.tform.back.setTabStopDistance(tab_width) self.redrawing = False def saveCard(self):