本文整理汇总了C++中MythUIType::objectName方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIType::objectName方法的具体用法?C++ MythUIType::objectName怎么用?C++ MythUIType::objectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIType
的用法示例。
在下文中一共展示了MythUIType::objectName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyFrom
void MythUIStateType::CopyFrom(MythUIType *base)
{
MythUIStateType *st = dynamic_cast<MythUIStateType *>(base);
if (!st)
return;
m_ShowEmpty = st->m_ShowEmpty;
MythUIType::CopyFrom(base);
QMap<QString, MythUIType *>::iterator i;
for (i = st->m_ObjectsByName.begin(); i != st->m_ObjectsByName.end(); ++i)
{
MythUIType *other = i.value();
QString key = i.key();
MythUIType *newtype = GetChild(other->objectName());
AddObject(key, newtype);
newtype->SetVisible(false);
}
QMap<int, MythUIType *>::iterator j;
for (j = st->m_ObjectsByState.begin(); j != st->m_ObjectsByState.end(); ++j)
{
MythUIType *other = j.value();
int key = j.key();
MythUIType *newtype = GetChild(other->objectName());
AddObject((StateType)key, newtype);
newtype->SetVisible(false);
}
}
示例2: setGridLayout
void ZMEvents::setGridLayout(int layout)
{
if (layout < 1 || layout > 3)
layout = 1;
if (layout == m_layout)
return;
if (m_eventGrid)
m_eventGrid->Reset();
m_layout = layout;
// iterate though the children showing/hiding them as appropriate
QString name;
QString layoutName = QString("layout%1").arg(layout);
QList<MythUIType *> *children = GetAllChildren();
for (int x = 0; x < children->size(); x++)
{
MythUIType *type = children->at(x);
name = type->objectName();
if (name.startsWith("layout"))
{
if (name.startsWith(layoutName))
type->SetVisible(true);
else
type->SetVisible(false);
}
}
// get the correct grid
m_eventGrid = dynamic_cast<MythUIButtonList *> (GetChild(layoutName + "_eventlist"));
if (m_eventGrid)
{
connect(m_eventGrid, SIGNAL(itemSelected( MythUIButtonListItem*)),
this, SLOT(eventChanged(MythUIButtonListItem*)));
connect(m_eventGrid, SIGNAL(itemClicked( MythUIButtonListItem*)),
this, SLOT(playPressed()));
connect(m_eventGrid, SIGNAL(itemVisible(MythUIButtonListItem*)),
this, SLOT(eventVisible(MythUIButtonListItem*)));
updateUIList();
BuildFocusList();
SetFocusWidget(m_eventGrid);
}
else
{
示例3: DeleteChild
/**
* \brief Delete a named child of this UIType
*
* \param Name of child
*/
void MythUIType::DeleteChild(const QString &name)
{
QMutableListIterator<MythUIType *> it(m_ChildrenList);
while (it.hasNext())
{
it.next();
MythUIType *type = it.value();
if (type->objectName() == name)
{
delete type;
it.remove();
return;
}
}
}