aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/memoryview.cpp
blob: bd5d6d8cd38d485b438c2655e93c90ac4ef8421c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "memoryview.h"

MemoryView::MemoryView(QWidget *parent) : QWidget(parent) {
    layout = new QVBoxLayout(this);

    frame = new QFrame(this);
    frame->setFrameShadow(QFrame::Sunken);
    frame->setFrameShape(QFrame::StyledPanel);
    frame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    // TODO
    layout->addWidget(frame);

    go_edit = new QLineEdit(this);
    go_edit->setText("0x00000000");
    go_edit->setInputMask("\\0\\xHHHHHHHH");
    layout->addWidget(go_edit);
    connect(go_edit, SIGNAL(editingFinished()), this, SLOT(go_edit_finish()));

}

MemoryView::~MemoryView() {
    delete go_edit;
    delete frame;
    delete layout;
}

void MemoryView::set_center(std::uint32_t address) {
    center_addr = address;
    // TODO update view
}

std::uint32_t MemoryView::center() {
    return center_addr;
}

void MemoryView::resizeEvent(QResizeEvent *event) {
    QWidget::resizeEvent(event);
    // TODO
}

void MemoryView::wheelEvent(QWheelEvent *event) {
    // TODO
}

void MemoryView::go_edit_finish() {
    // TODO
}