MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / KeyHistoryWidget

Method KeyHistoryWidget

gui/qt/keyhistorywidget.cpp:7–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <QtWidgets/QHBoxLayout>
6
7KeyHistoryWidget::KeyHistoryWidget(QWidget *parent, int size) : QWidget{parent} {
8 QHBoxLayout *hlayout = new QHBoxLayout();
9
10 m_btnClear = new QPushButton(tr("Clear History"));
11 m_label = new QLabel(tr("Size"));
12 m_view = new QPlainTextEdit();
13 m_size = new QSpinBox();
14 m_spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred);
15 m_chkBoxVertical = new QCheckBox(tr("Print Vertically"));
16
17 m_view->setReadOnly(true);
18 m_view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
19
20 hlayout->addWidget(m_btnClear);
21 hlayout->addSpacerItem(m_spacer);
22 hlayout->addWidget(m_label);
23 hlayout->addWidget(m_size);
24 hlayout->addWidget(m_chkBoxVertical);
25
26 QVBoxLayout *vlayout = new QVBoxLayout();
27 vlayout->addWidget(m_view);
28 vlayout->addLayout(hlayout);
29 setLayout(vlayout);
30
31 connect(m_btnClear, &QPushButton::clicked, m_view, &QPlainTextEdit::clear);
32 connect(m_size, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &KeyHistoryWidget::setFontSize);
33
34 setFontSize(size);
35}
36
37KeyHistoryWidget::~KeyHistoryWidget() = default;
38

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected