| 4 | #include "util.h" |
| 5 | |
| 6 | AnalysisInfoWidget::AnalysisInfoWidget(QWidget* parent, BinaryViewRef data): QWidget(parent), m_data(data) |
| 7 | { |
| 8 | m_layout = new QGridLayout(); |
| 9 | m_layout->setContentsMargins(0, 0, 0, 0); |
| 10 | m_layout->setVerticalSpacing(1); |
| 11 | |
| 12 | auto* gpValueLayout = new QHBoxLayout(); |
| 13 | gpValueLayout->setContentsMargins(0, 0, 0, 0); |
| 14 | m_gpLabel = new NavigationAddressLabel(""); |
| 15 | m_gpLabel->setFont(getMonospaceFont(this)); |
| 16 | gpValueLayout->addWidget(m_gpLabel); |
| 17 | |
| 18 | m_gpExtraLabel = new QLabel; |
| 19 | gpValueLayout->addWidget(m_gpExtraLabel); |
| 20 | |
| 21 | m_layout->addWidget(new QLabel("Global Pointer Value:"), 0, 0); |
| 22 | m_layout->addLayout(gpValueLayout, 0, 1); |
| 23 | |
| 24 | const auto scaledWidth = UIContext::getScaledWindowSize(20, 20).width(); |
| 25 | this->m_layout->setColumnMinimumWidth(AnalysisInfoWidget::m_maxColumns * 3 - 1, scaledWidth); |
| 26 | this->m_layout->setColumnStretch(AnalysisInfoWidget::m_maxColumns * 3 - 1, 1); |
| 27 | setLayout(m_layout); |
| 28 | |
| 29 | updateDisplay(); |
| 30 | |
| 31 | auto* timer = new QTimer(this); |
| 32 | connect(timer, &QTimer::timeout, this, &AnalysisInfoWidget::timerExpired); |
| 33 | timer->setInterval(100); |
| 34 | timer->setSingleShot(false); |
| 35 | timer->start(); |
| 36 | } |
| 37 | |
| 38 | |
| 39 | AnalysisInfoWidget::~AnalysisInfoWidget() |