Save column width for ImageInfo

This commit is contained in:
2022-04-08 18:28:15 +02:00
parent 0e985d7799
commit 7afb12d9cc
2 changed files with 12 additions and 1 deletions
+10
View File
@@ -1,4 +1,6 @@
#include "imageinfo.h"
#include <QSettings>
#include <QHeaderView>
static const QVector<QByteArray> noEditableKey = {"SIMPLE", "BITPIX", "NAXIS", "NAXIS1", "NAXIS2", "NAXIS3", "EXTEND", "BZERO", "BSCALE"};
@@ -12,6 +14,14 @@ ImageInfo::ImageInfo(QWidget *parent) : QTreeWidget(parent)
setColumnCount(3);
setHeaderLabels({tr("Property"), tr("Value"), tr("Comment")});
setIndentation(5);
QSettings settings;
header()->restoreState(settings.value("imageinfo/headerstate").toByteArray());
}
ImageInfo::~ImageInfo()
{
QSettings settings;
settings.setValue("imageinfo/headerstate", header()->saveState());
}
void ImageInfo::setInfo(const ImageInfoData &info)