PrimeWorldEditor/UI/IPreviewPanel.cpp

25 lines
749 B
C++
Raw Normal View History

#include "IPreviewPanel.h"
#include "WScanPreviewPanel.h"
#include "WStringPreviewPanel.h"
#include "WTexturePreviewPanel.h"
IPreviewPanel::IPreviewPanel(QWidget *parent) : QFrame(parent)
{
setFrameShape(QFrame::StyledPanel);
setFrameShadow(QFrame::Plain);
setLineWidth(2);
}
// Can add more if more preview types are implemented
// Not every resource type is really suitable for this though unfortunately
IPreviewPanel* IPreviewPanel::CreatePanel(EResType Type, QWidget *pParent)
{
switch (Type)
{
2015-07-28 05:47:48 +00:00
case eTexture: return new WTexturePreviewPanel(pParent);
case eStringTable: return new WStringPreviewPanel(pParent);
2015-07-28 05:47:48 +00:00
case eScan: return new WScanPreviewPanel(pParent);
default: return nullptr;
}
}