valgrind fix

This commit is contained in:
Roy Qu 2022-04-25 11:06:12 +08:00
parent 2056d42286
commit 16cb8faf85
1 changed files with 5 additions and 5 deletions

View File

@ -43,6 +43,7 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
mDropped(false) mDropped(false)
{ {
mCharWidth=1; mCharWidth=1;
mTextHeight = 1;
mLastKey = 0; mLastKey = 0;
mLastKeyModifiers = Qt::NoModifier; mLastKeyModifiers = Qt::NoModifier;
mModified = false; mModified = false;
@ -56,6 +57,7 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
#else #else
#error "Not supported!" #error "Not supported!"
#endif #endif
mFontDummy.setStyleStrategy(QFont::PreferAntialias);
mDocument = std::make_shared<SynDocument>(mFontDummy, this); mDocument = std::make_shared<SynDocument>(mFontDummy, this);
//fPlugins := TList.Create; //fPlugins := TList.Create;
mMouseMoved = false; mMouseMoved = false;
@ -69,10 +71,8 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
mGutterWidth = 0; mGutterWidth = 0;
mScrollBars = SynScrollStyle::ssBoth; mScrollBars = SynScrollStyle::ssBoth;
mFontDummy.setStyleStrategy(QFont::PreferAntialias);
setFont(mFontDummy);
setFontForNonAscii(mFontDummy);
mUndoList = std::make_shared<SynEditUndoList>(); mUndoList = std::make_shared<SynEditUndoList>();
mUndoList->connect(mUndoList.get(), &SynEditUndoList::addedUndo, this, &SynEdit::onUndoAdded); mUndoList->connect(mUndoList.get(), &SynEditUndoList::addedUndo, this, &SynEdit::onUndoAdded);
@ -152,8 +152,6 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
m_blinkTimerId = 0; m_blinkTimerId = 0;
m_blinkStatus = 0; m_blinkStatus = 0;
synFontChanged();
hideCaret(); hideCaret();
connect(horizontalScrollBar(),&QScrollBar::valueChanged, connect(horizontalScrollBar(),&QScrollBar::valueChanged,
@ -166,6 +164,8 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
//setMouseTracking(true); //setMouseTracking(true);
setAcceptDrops(true); setAcceptDrops(true);
setFont(mFontDummy);
setFontForNonAscii(mFontDummy);
} }
int SynEdit::displayLineCount() const int SynEdit::displayLineCount() const