dust3d/application/sources/material_widget.h

39 lines
941 B
C
Raw Normal View History

#ifndef DUST3D_APPLICATION_MATERIAL_WIDGET_H_
#define DUST3D_APPLICATION_MATERIAL_WIDGET_H_
#include "model_widget.h"
#include <QFrame>
#include <QIcon>
#include <QLabel>
2020-12-19 02:29:24 +00:00
#include <QPushButton>
2020-12-19 02:29:24 +00:00
class Document;
class MaterialWidget : public QFrame {
Q_OBJECT
signals:
void modifyMaterial(dust3d::Uuid materialId);
public:
MaterialWidget(const Document* document, dust3d::Uuid materialId);
static int preferredHeight();
ModelWidget* previewWidget();
protected:
void mouseDoubleClickEvent(QMouseEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
public slots:
void reload();
void updatePreview(dust3d::Uuid materialId);
void updateName(dust3d::Uuid materialId);
void updateCheckedState(bool checked);
private:
dust3d::Uuid m_materialId;
const Document* m_document = nullptr;
ModelWidget* m_previewWidget = nullptr;
QLabel* m_nameLabel = nullptr;
};
#endif