MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / ElaPlainTextEdit

Method ElaPlainTextEdit

ElaWidgetTools/ElaPlainTextEdit.cpp:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "ElaScrollBar.h"
14#include "ElaTheme.h"
15ElaPlainTextEdit::ElaPlainTextEdit(QWidget* parent)
16 : QPlainTextEdit(parent), d_ptr(new ElaPlainTextEditPrivate())
17{
18 Q_D(ElaPlainTextEdit);
19 d->q_ptr = this;
20 setObjectName("ElaPlainTextEdit");
21 setStyleSheet("#ElaPlainTextEdit{background-color:transparent;}");
22 setHorizontalScrollBar(new ElaScrollBar(this));
23 setVerticalScrollBar(new ElaScrollBar(this));
24 setMouseTracking(true);
25 // 事件总线
26 d->_focusEvent = new ElaEvent("WMWindowClicked", "onWMWindowClickedEvent", d);
27 d->_focusEvent->registerAndInit();
28
29 d->_style = new ElaPlainTextEditStyle(style());
30 setStyle(d->_style);
31 d->onThemeChanged(eTheme->getThemeMode());
32 connect(eTheme, &ElaTheme::themeModeChanged, d, &ElaPlainTextEditPrivate::onThemeChanged);
33}
34
35ElaPlainTextEdit::ElaPlainTextEdit(const QString& text, QWidget* parent)
36 : ElaPlainTextEdit(parent)

Callers

nothing calls this directly

Calls 3

registerAndInitMethod · 0.80
getThemeModeMethod · 0.80
onThemeChangedMethod · 0.45

Tested by

no test coverage detected