47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <QWidget>
|
||
|
|
#include <QStringList>
|
||
|
|
#include <QTableWidget>
|
||
|
|
|
||
|
|
class ImageGridWidget;
|
||
|
|
|
||
|
|
class ImageGridWithTableWidget : public QWidget {
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
explicit ImageGridWithTableWidget(QWidget* parent = nullptr);
|
||
|
|
|
||
|
|
void setImages(int index, const QImage& image);
|
||
|
|
void initImages(int count);
|
||
|
|
void setSelectedIndex(int index);
|
||
|
|
int selectedIndex() const;
|
||
|
|
|
||
|
|
void setExpandedIndex(int index);
|
||
|
|
int expandedIndex() const;
|
||
|
|
|
||
|
|
int columnCount() const;
|
||
|
|
int rowCount() const;
|
||
|
|
QSize tileBaseSize() const;
|
||
|
|
|
||
|
|
ImageGridWidget* gridWidget() const { return m_grid; }
|
||
|
|
QTableWidget* tableWidget() const { return m_table; }
|
||
|
|
|
||
|
|
signals:
|
||
|
|
void tileClicked(int index);
|
||
|
|
|
||
|
|
private slots:
|
||
|
|
void onGridTileClicked(int index);
|
||
|
|
void onTableSelectionChanged();
|
||
|
|
|
||
|
|
private:
|
||
|
|
void setupUi();
|
||
|
|
void syncSelectionToTable(int index);
|
||
|
|
void syncSelectionToGrid();
|
||
|
|
|
||
|
|
protected:
|
||
|
|
void resizeEvent(QResizeEvent* event) override;
|
||
|
|
|
||
|
|
ImageGridWidget* m_grid {nullptr};
|
||
|
|
QTableWidget* m_table {nullptr};
|
||
|
|
QStringList m_paths;
|
||
|
|
};
|