// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include #include #include #include "JFJochHelperWindow.h" #include "../../reader/JFJochReader.h" class JFJochViewerImageListWindow : public JFJochHelperWindow { Q_OBJECT QTableView *tableView; QStandardItemModel *tableModel; QSortFilterProxyModel *proxyModel; void setupTableModel(); void addDataRow(int imageNumber, double backgroundEstimate, const QString &indexingResult, int spotCount, double resolutionEstimate, int64_t max_value, double image_scale_factor, double image_scale_cc_percent); void clearAllData(); void fillTable(); void setRowBackground(int row, const QBrush &brush); // Filling the table is one row per image, so it is skipped while the window is closed: the // dataset is kept here and showEvent() fills it. highlighted_row is the row currently marked // as the loaded image, so only it and its successor need repainting per frame. std::shared_ptr dataset; bool pending_fill = false; int highlighted_row = -1; public: explicit JFJochViewerImageListWindow(QWidget *parent = nullptr); protected: void showEvent(QShowEvent *event) override; signals: void imageSelected(int64_t image_number, int64_t summation); public slots: void datasetLoaded(std::shared_ptr dataset) override; void imageLoaded(std::shared_ptr image) override; private slots: void onTableRowDoubleClicked(const QModelIndex &index); };