Files
pilotclient/src/blackgui/components/enablefordockwidgetinfoarea.cpp
Klaus Basan df5169ee98 refs #335, renaming
* the term "components" will only be used for GUI components (derived from QWidget/ QWidget derived classes) fron now on
* timer, and enabler classes renamed accordingly: CEnableForRuntime, CEnableForDockWidgetInfoArea, CUpdateTimer
* adjusted all dependent classes
2014-11-29 22:38:53 +01:00

73 lines
2.6 KiB
C++

/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "enablefordockwidgetinfoarea.h"
namespace BlackGui
{
namespace Components
{
CEnableForDockWidgetInfoArea::CEnableForDockWidgetInfoArea(QWidget *parent)
{
// it the parent is already an info area at this time, we keep it
// otherwise we expect the info area to set it later
CDockWidgetInfoArea *ia = dynamic_cast<CDockWidgetInfoArea *>(parent);
if (ia)
{
this->m_parentDockableInfoArea = ia;
}
}
bool CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget)
{
// sanity check
if (this->m_parentDockableInfoArea)
{
// we already have a value
// changes should not happen
Q_ASSERT(this->m_parentDockableInfoArea == parentDockableWidget);
return this->m_parentDockableInfoArea == parentDockableWidget;
}
m_parentDockableInfoArea = parentDockableWidget;
return true;
}
const CInfoArea *CEnableForDockWidgetInfoArea::getParentInfoArea() const
{
Q_ASSERT(this->m_parentDockableInfoArea);
if (!this->m_parentDockableInfoArea) return nullptr;
return this->m_parentDockableInfoArea->getParentInfoArea();
}
CInfoArea *CEnableForDockWidgetInfoArea::getParentInfoArea()
{
Q_ASSERT(this->m_parentDockableInfoArea);
if (!this->m_parentDockableInfoArea) return nullptr;
return this->m_parentDockableInfoArea->getParentInfoArea();
}
bool CEnableForDockWidgetInfoArea::isParentDockWidgetFloating() const
{
Q_ASSERT(this->m_parentDockableInfoArea);
if (!this->m_parentDockableInfoArea) return false;
return this->m_parentDockableInfoArea->isFloating();
}
bool CEnableForDockWidgetInfoArea::isVisibleWidget() const
{
Q_ASSERT(this->m_parentDockableInfoArea);
if (!this->m_parentDockableInfoArea) return false;
return this->m_parentDockableInfoArea->isVisibleWidget();
}
} // namespace
} // namespace