implement a specialized findChild; this makes it look like there's the usual findChild, but this one is defanged
svn path=/trunk/KDE/kdebase/runtime/; revision=1070552
This commit is contained in:
parent
092bf9d3e6
commit
5946da0f42
@ -349,6 +349,22 @@ void AppletInterface::debug(const QString &msg)
|
|||||||
kDebug() << msg;
|
kDebug() << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QObject *AppletInterface::findChild(const QString &name) const
|
||||||
|
{
|
||||||
|
if (name.isEmpty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (QGraphicsItem *item, applet()->childItems()) {
|
||||||
|
QGraphicsWidget *widget = dynamic_cast<QGraphicsWidget *>(item);
|
||||||
|
if (widget && widget->objectName() == name) {
|
||||||
|
return widget;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void AppletInterface::gc()
|
void AppletInterface::gc()
|
||||||
{
|
{
|
||||||
QTimer::singleShot(0, m_appletScriptEngine, SLOT(collectGarbage()));
|
QTimer::singleShot(0, m_appletScriptEngine, SLOT(collectGarbage()));
|
||||||
|
@ -224,6 +224,7 @@ enum QtScrollBarPolicy {
|
|||||||
Q_INVOKABLE bool hasExtension(const QString &extension) const;
|
Q_INVOKABLE bool hasExtension(const QString &extension) const;
|
||||||
|
|
||||||
Q_INVOKABLE void debug(const QString &msg);
|
Q_INVOKABLE void debug(const QString &msg);
|
||||||
|
Q_INVOKABLE QObject *findChild(const QString &name) const;
|
||||||
|
|
||||||
Plasma::DataEngine *dataEngine(const QString &name);
|
Plasma::DataEngine *dataEngine(const QString &name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user