mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
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
This commit is contained in:
committed by
Roland Winklmeier
parent
bb8b515c87
commit
df5169ee98
72
src/blackgui/components/enablefordockwidgetinfoarea.cpp
Normal file
72
src/blackgui/components/enablefordockwidgetinfoarea.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
/* 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
|
||||
Reference in New Issue
Block a user