leocad/common/lc_previewwidget.h
2020-12-25 10:54:33 -08:00

53 lines
835 B
C++

#pragma once
#include "lc_view.h"
class lcPreview;
class lcPreviewDockWidget : public QMainWindow
{
Q_OBJECT
public:
explicit lcPreviewDockWidget(QMainWindow* Parent = nullptr);
bool SetCurrentPiece(const QString& PartType, int ColorCode);
void ClearPreview();
void UpdatePreview();
protected slots:
void SetPreviewLock();
protected:
QAction* mLockAction;
QToolBar* mToolBar;
QLabel* mLabel;
lcPreview* mPreview;
lcViewWidget* mViewWidget;
};
class lcPreview : public lcView
{
public:
lcPreview();
QString GetDescription() const
{
return mDescription;
}
bool IsModel() const
{
return mIsModel;
}
void ClearPreview();
void UpdatePreview();
bool SetCurrentPiece(const QString& PartType, int ColorCode);
protected:
std::unique_ptr<Project> mLoader;
QString mDescription;
bool mIsModel = false;
};