mirror of
https://github.com/epasveer/seer.git
synced 2026-08-31 01:20:45 +08:00
Add a row-major/column-major selector to the Matrix Visualizer
This commit is contained in:
@@ -40,8 +40,10 @@ SeerMatrixVisualizerWidget::SeerMatrixVisualizerWidget (QWidget* parent) : QWidg
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
matrixDisplayFormatComboBox->setCurrentIndex(0);
|
||||
matrixStorageOrderComboBox->setCurrentIndex(0);
|
||||
|
||||
handleMatrixDisplayFormatComboBox(0);
|
||||
handleMatrixStorageOrderComboBox(0);
|
||||
|
||||
variableNameLineEdit->enableReturnPressedOnClear();
|
||||
|
||||
@@ -59,6 +61,7 @@ SeerMatrixVisualizerWidget::SeerMatrixVisualizerWidget (QWidget* parent) : QWidg
|
||||
QObject::connect(matrixStrideLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerMatrixVisualizerWidget::handleRefreshButton);
|
||||
QObject::connect(matrixStrideLineEdit, &SeerHistoryLineEdit::editingFinished, this, &SeerMatrixVisualizerWidget::handleElementStrideLineEdit);
|
||||
QObject::connect(matrixDisplayFormatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerMatrixVisualizerWidget::handleMatrixDisplayFormatComboBox);
|
||||
QObject::connect(matrixStorageOrderComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerMatrixVisualizerWidget::handleMatrixStorageOrderComboBox);
|
||||
QObject::connect(matrixTableWidget, &SeerMatrixWidget::dataChanged, this, &SeerMatrixVisualizerWidget::handleDataChanged);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 3)
|
||||
QObject::connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, &SeerMatrixVisualizerWidget::handleThemeChanged);
|
||||
@@ -563,6 +566,16 @@ void SeerMatrixVisualizerWidget::handleMatrixDisplayFormatComboBox (int index) {
|
||||
handleRefreshButton();
|
||||
}
|
||||
|
||||
void SeerMatrixVisualizerWidget::handleMatrixStorageOrderComboBox (int index) {
|
||||
|
||||
// Same bytes, only the cell mapping changes, so no memory re-read is needed.
|
||||
if (index == 1) {
|
||||
matrixTableWidget->setStorageOrder(SeerMatrixWidget::ColumnMajor);
|
||||
}else{
|
||||
matrixTableWidget->setStorageOrder(SeerMatrixWidget::RowMajor);
|
||||
}
|
||||
}
|
||||
|
||||
void SeerMatrixVisualizerWidget::handleDataChanged () {
|
||||
|
||||
// Update the meta information.
|
||||
|
||||
Reference in New Issue
Block a user