37 lines
568 B
C++
37 lines
568 B
C++
#include "itemwidget.h"
|
|
|
|
#include <QCheckBox>
|
|
#include <QDebug>
|
|
#include <QSlider>
|
|
#include "../items/train.h"
|
|
#include "../items/turnout.h"
|
|
|
|
ItemWidget::ItemWidget(std::weak_ptr<Item> item, QWidget *parent) :
|
|
QWidget(parent),
|
|
item_(item)
|
|
{
|
|
qDebug()<<__func__<<" "<<(bool)item_.lock();
|
|
|
|
}
|
|
|
|
bool ItemWidget::controles(const ItemData& relay)
|
|
{
|
|
if(auto workingRelay = item_.lock())
|
|
{
|
|
if(relay == *workingRelay)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
std::weak_ptr<Item> ItemWidget::getItem()
|
|
{
|
|
return item_;
|
|
}
|
|
|
|
ItemWidget::~ItemWidget()
|
|
{
|
|
}
|