aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/memorytableview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_gui/memorytableview.cpp')
-rw-r--r--qtmips_gui/memorytableview.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qtmips_gui/memorytableview.cpp b/qtmips_gui/memorytableview.cpp
index 8435e35..9b5cddf 100644
--- a/qtmips_gui/memorytableview.cpp
+++ b/qtmips_gui/memorytableview.cpp
@@ -42,8 +42,7 @@ MemoryTableView::MemoryTableView(QWidget *parent) : Super(parent) {
}
-void MemoryTableView::resizeEvent(QResizeEvent *event) {
- Super::resizeEvent(event);
+void MemoryTableView::adjustColumnCount() {
MemoryModel *m = dynamic_cast<MemoryModel*>(model());
if (horizontalHeader()->count() >= 2 && m != nullptr) {
@@ -77,3 +76,12 @@ void MemoryTableView::resizeEvent(QResizeEvent *event) {
}
}
}
+
+void MemoryTableView::adap_to_cell_size() {
+ adjustColumnCount();
+}
+
+void MemoryTableView::resizeEvent(QResizeEvent *event) {
+ Super::resizeEvent(event);
+ adjustColumnCount();
+}