2020-01-05 22:46:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QTableView>
|
2024-03-21 14:24:08 -04:00
|
|
|
#include "MemoryViewModel.h"
|
2020-02-07 07:23:23 +00:00
|
|
|
#include "signal/Signal.h"
|
2020-01-05 22:46:47 +00:00
|
|
|
|
|
|
|
class QResizeEvent;
|
|
|
|
|
2024-03-19 15:10:16 -04:00
|
|
|
class CMemoryViewTable : public QTableView
|
2020-01-05 22:46:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-01-06 12:40:18 +00:00
|
|
|
CMemoryViewTable(QWidget*);
|
2020-02-06 14:12:26 +00:00
|
|
|
~CMemoryViewTable() = default;
|
2020-01-05 22:46:47 +00:00
|
|
|
|
|
|
|
int GetBytesPerLine();
|
|
|
|
void SetBytesPerLine(int);
|
|
|
|
|
2024-03-21 14:24:08 -04:00
|
|
|
void SetData(CMemoryViewModel::getByteProto, uint64, uint32 = 0);
|
2023-08-12 10:31:28 -04:00
|
|
|
void SetSelectionStart(uint32);
|
2020-01-05 22:46:47 +00:00
|
|
|
|
|
|
|
void ShowEvent();
|
|
|
|
void ResizeEvent();
|
|
|
|
|
|
|
|
Framework::CSignal<void(uint32)> OnSelectionChange;
|
|
|
|
|
2021-02-11 10:43:52 -05:00
|
|
|
protected:
|
|
|
|
int sizeHintForColumn(int) const override;
|
|
|
|
|
2024-03-21 14:24:08 -04:00
|
|
|
CMemoryViewModel* m_model = nullptr;
|
2024-03-19 15:10:16 -04:00
|
|
|
uint32 m_selected = 0;
|
|
|
|
|
2020-01-05 22:46:47 +00:00
|
|
|
private:
|
2021-02-13 11:51:05 -05:00
|
|
|
int ComputeItemCellWidth() const;
|
|
|
|
|
2020-01-05 22:46:47 +00:00
|
|
|
void ShowContextMenu(const QPoint&);
|
|
|
|
void AutoColumn();
|
|
|
|
void SetActiveUnit(int);
|
|
|
|
void SelectionChanged();
|
|
|
|
|
2024-03-19 15:10:16 -04:00
|
|
|
virtual void PopulateContextMenu(QMenu*){};
|
2020-01-05 22:46:47 +00:00
|
|
|
|
|
|
|
int m_cwidth = 0;
|
|
|
|
int m_bytesPerLine = 0;
|
|
|
|
int m_maxUnits = 0;
|
|
|
|
};
|