/
githubmirror
/
x64dbg
Обзор
Документация
Войти
/
githubmirror
/
x64dbg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
development
src/gui/Src/Gui/NotepadView.cpp
35 строк
1 KB
Duncan Ogilvie
GUI: refactor BridgeResult and fix a bunch of bugs in the process
22 июн 2019, 14:29
Не верифицирован
22 июн 2019, 14:29
3dc120d
Код
Авторство
О чём код?
#include "NotepadView.h" #include "Configuration.h" #include "Bridge.h" #include <QMessageBox> NotepadView::NotepadView(QWidget* parent, BridgeResult::Type type) : QPlainTextEdit(parent), mType(type) { updateStyle(); connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateStyle())); connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(updateStyle())); } void NotepadView::updateStyle() { setFont(ConfigFont("Log")); setStyleSheet(QString("QPlainTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("AbstractTableViewTextColor").name(), ConfigColor("AbstractTableViewBackgroundColor").name())); } void NotepadView::setNotes(const QString text) { setPlainText(text); } void NotepadView::getNotes(void* ptr) { QByteArray text = toPlainText().replace('\n', "\r\n").toUtf8(); char* result = 0; if(text.length()) { result = (char*)BridgeAlloc(text.length() + 1); strcpy_s(result, text.length() + 1, text.constData()); } *(char**)ptr = result; Bridge::getBridge()->setResult(mType); }