void MainWindowsEventHandling::ConnectQmlSignals(QObject *rootObject) { QQuickItem *historyGraph = FindItemByName(rootObject,QString("historyGraph")); QQuickItem *vectorGraph = FindItemByName(rootObject,QString("vectorGraph")); if (historyGraph) { QObject::connect(this, SIGNAL(historyContextUpdated()), historyGraph, SLOT(requestPaint())); QObject::connect(this, SIGNAL(historyContextUpdated()), vectorGraph, SLOT(requestPaint())); } else { qDebug() << "HIBA: Nem találom a historyGraph objektumot a QML környezetben."; } }
HICON CIconPool::GetIcon(const char *name, bool big) { if (CPoolItem *item = FindItemByName(name)) return Skin_GetIconByHandle(item->m_hIcolibItem, big); return NULL; }
char *CIconPool::GetIcolibName(const char *name) { if (CPoolItem *item = FindItemByName(name)) return item->m_szIcolibName; return NULL; }
HANDLE CIconPool::GetIcolibHandle(const char *name) { if (CPoolItem *item = FindItemByName(name)) return item->m_hIcolibItem; return NULL; }
void vmsCookie::Add(vmsCookie *pc) { for (int i = 0; i < pc->get_ItemCount (); i++) { if (-1 == FindItemByName (pc->get_Item (i)->strName.c_str ())) m_vItems.push_back (*pc->get_Item (i)); } }
int FindActiveIndex() const { const auto *map = UIGlobals::GetMap(); if (map == nullptr) return -1; const MapOverlay *o = map->GetOverlay(); if (o == nullptr) return -1; const MapOverlayBitmap *ob = dynamic_cast<const MapOverlayBitmap *>(o); if (ob == nullptr) return -1; return FindItemByName(ob->GetLabel()); }
int vmsCookie::GetCommonItemCount(vmsCookie *pc) { int c = 0; for (int i = 0; i < pc->get_ItemCount (); i++) { int n = FindItemByName (pc->get_Item (i)->strName.c_str ()); if (n != -1) { if (pc->get_Item (i)->strValue == m_vItems [n].strValue) c++; } } return c; }
QQuickItem* MainWindowsEventHandling::FindItemByName(QList<QObject*> nodes, const QString& name) { for(int i = 0; i < nodes.size(); i++) { // Node keresése if (nodes.at(i) && nodes.at(i)->objectName() == name) { return dynamic_cast<QQuickItem*>(nodes.at(i)); } // Gyerekekben keresés else if (nodes.at(i) && nodes.at(i)->children().size() > 0) { QQuickItem* item = FindItemByName(nodes.at(i)->children(), name); if (item) return item; } } // Nem találtuk. return nullptr; }
QQuickItem* MainWindowsEventHandling::FindItemByName(QObject *rootObject, const QString& name) { return FindItemByName(rootObject->children(), name); }
void wxSwitcherItems::SetSelection(const wxString& name) { int idx = FindItemByName(name); if (idx != -1) SetSelection(idx); }