From 16cb8faf85455a8b2dc3d2c1b626b448af7d73fb Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 25 Apr 2022 11:06:12 +0800 Subject: [PATCH] valgrind fix --- RedPandaIDE/qsynedit/SynEdit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index dd53f6ba..d1891fa0 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -43,6 +43,7 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent), mDropped(false) { mCharWidth=1; + mTextHeight = 1; mLastKey = 0; mLastKeyModifiers = Qt::NoModifier; mModified = false; @@ -56,6 +57,7 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent), #else #error "Not supported!" #endif + mFontDummy.setStyleStrategy(QFont::PreferAntialias); mDocument = std::make_shared(mFontDummy, this); //fPlugins := TList.Create; mMouseMoved = false; @@ -69,10 +71,8 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent), mGutterWidth = 0; mScrollBars = SynScrollStyle::ssBoth; - mFontDummy.setStyleStrategy(QFont::PreferAntialias); - setFont(mFontDummy); - setFontForNonAscii(mFontDummy); + mUndoList = std::make_shared(); mUndoList->connect(mUndoList.get(), &SynEditUndoList::addedUndo, this, &SynEdit::onUndoAdded); @@ -152,8 +152,6 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent), m_blinkTimerId = 0; m_blinkStatus = 0; - synFontChanged(); - hideCaret(); connect(horizontalScrollBar(),&QScrollBar::valueChanged, @@ -166,6 +164,8 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent), //setMouseTracking(true); setAcceptDrops(true); + setFont(mFontDummy); + setFontForNonAscii(mFontDummy); } int SynEdit::displayLineCount() const