From kde-panel-devel Tue Nov 29 20:59:10 2016 From: Michail Vourlakos Date: Tue, 29 Nov 2016 20:59:10 +0000 To: kde-panel-devel Subject: Re: [Technical Question] - How to trigger the applets actions menu from a second window of a Panel? Message-Id: X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=148045316604103 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------ED6F26D31E90FEFA0C6DA5D2" This is a multi-part message in MIME format. --------------ED6F26D31E90FEFA0C6DA5D2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > ---- > > Plasma::Applet *applet = 0; > foreach (QObject *appletObject, m_appletInterfaces) { > if (AppletInterface *ai = qobject_cast *>(appletObject)) { > if (ai->isVisible() && ai->contains(ai->mapFromItem(this, > event->posF()))) { > applet = ai->applet(); > break; > } else { > ai = 0; > } > } > } > > --- > > for the m_appletsInterfaces I can use the plasmoid.applets variable to > get them but AppletInterface is not exposed in plasma library and I > need it in order to get its applet() ///Plasma::Applet > > no worries about that, I solved this by accessing the PlasmaQuick::AppletQuickItem's ... --------------ED6F26D31E90FEFA0C6DA5D2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

----

   Plasma::Applet *applet = 0;
    foreach (QObject *appletObject, m_appletInterfaces) {
        if (AppletInterface *ai = qobject_cast<AppletInterface *>(appletObject)) {
            if (ai->isVisible() && ai->contains(ai->mapFromItem(this, event->posF()))) {
                applet = ai->applet();
                break;
            } else {
                ai = 0;
            }
        }
    }

---

for the m_appletsInterfaces I can use the plasmoid.applets variable to get them but AppletInterface is not exposed in plasma library and I need it in order to get its applet()   ///Plasma::Applet



no worries about that, I solved this by accessing the PlasmaQuick::AppletQuickItem's ...


--------------ED6F26D31E90FEFA0C6DA5D2--