> On Tuesday 23 August 2011, Onur-Hayri Bakici wrote: > > > On Tuesday, August 23, 2011 10:35:18 Onur-Hayri Bakici wrote: > > > > is there any way to get the x,y position of plasmoids using > > > > javascript? > > > > > > You mean on the screen? No, by design it's not possible. > > > > > > What do you want to achieve? > > > > I want to let a PlasmaCore.Dialog to appear underneath the applet. I use > > QML. For the right position I need the x,y coordinates. > > use the popupposition method of PlasmaCore.Dialog > > never never ever try to calculate this kind of stuff by hand
Thanks for the quick response. However I still cannot go any further. Since popupPosition gets a QGraphicsObject but always returns an emty QPoint. A little example of what I did. Item { PlasmaWidgets.PushButton { id: btn text: "press me" onClicked: { dialog.visible = true; } } PlasmaCore.Dialog { id: dialog Component.onCompleted: { setAttribute(Qt.WA_X11NetWmWindowTypeDock, true); var pos = popupPosition(parent); // or popupPosition(btn)? print("QPoint: " + pos.x + "," + pos.y); } } } Can you tell me whats wrong with this code? Thanks in advance. _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel