36 lines
792 B
C++
Executable File
36 lines
792 B
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Philipp Last, NLSE, 2018-03-29
|
|
*/
|
|
#include "bdv_bgviewer_widget_container.h"
|
|
#include <QGridLayout>
|
|
|
|
namespace BuildingViewer
|
|
{
|
|
BgViewerWidgetContainer::BgViewerWidgetContainer(QWidget *pBgViewerWidget)
|
|
: QWidget()
|
|
, m_pBgViewerWidget(pBgViewerWidget)
|
|
{
|
|
auto gl = new QGridLayout(this);
|
|
gl->setContentsMargins(QMargins());
|
|
gl->setSpacing(0);
|
|
if (m_pBgViewerWidget)
|
|
gl->addWidget(m_pBgViewerWidget);
|
|
}
|
|
|
|
|
|
BgViewerWidgetContainer::~BgViewerWidgetContainer()
|
|
{
|
|
if (m_pBgViewerWidget)
|
|
{
|
|
layout()->removeWidget(m_pBgViewerWidget);
|
|
m_pBgViewerWidget->setParent(nullptr); // Removing is not sufficient, we also have to reset the parent to prevent deletion
|
|
emit signalWidgetReleased();
|
|
}
|
|
}
|
|
|
|
}
|